repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aliyun/SimAI | https://github.com/aliyun/SimAI | null | null | null | null | 956 | null | null | apache-2.0 | null | null | null | null | null | null | null | vidur-alibabacloud/vidur/entities/interconnect.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:31.700822 | import logging # Import logging module for recording runtime information
from dataclasses import dataclass, field # Import dataclass tools for defining classes
from enum import IntEnum # Import IntEnum for defining integer enumeration types
# from flow import Flow
# from processor import CPU, GPU
# from simula... |
aliyun/SimAI | https://github.com/aliyun/SimAI | null | null | null | null | 956 | null | null | apache-2.0 | null | null | null | null | null | null | null | vidur-alibabacloud/vidur/entities/node.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:31.711334 | import logging
from dataclasses import dataclass, field
from enum import IntEnum
# from metrics import NodeMetrics
# from simulator import clock, schedule_event, cancel_event, reschedule_event
class NodeState(IntEnum): # Define integer enumeration representing various node states
NONE = 0 # Uninitialized ... |
aliyun/SimAI | https://github.com/aliyun/SimAI | null | null | null | null | 956 | null | null | apache-2.0 | null | null | null | null | null | null | null | vidur-alibabacloud/vidur/entities/processor.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:31.901071 | import logging
import os
from dataclasses import dataclass, field
from enum import IntEnum
# from instance import Instance
# from simulator import clock, schedule_event, cancel_event, reschedule_event
# >
from vidur.entities.replica import Replica
class ProcessorType(IntEnum):
DEFAULT = 0 # Default processor ty... |
aliyun/SimAI | https://github.com/aliyun/SimAI | null | null | null | null | 956 | null | null | apache-2.0 | null | null | null | null | null | null | null | vidur-alibabacloud/vidur/entities/replica.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:31.931728 | from math import ceil
from typing import Tuple
from vidur.config import BaseRequestGeneratorConfig, ReplicaConfig
from vidur.entities.base_entity import BaseEntity
from vidur.logger import init_logger
logger = init_logger(__name__)
# >
import bisect
from enum import IntEnum
class ReplicaType(IntEnum): ... |
aliyun/SimAI | https://github.com/aliyun/SimAI | null | null | null | null | 956 | null | null | apache-2.0 | null | null | null | null | null | null | null | vidur-alibabacloud/vidur/entities/request.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:32.036809 | from typing import Tuple
from vidur.entities.base_entity import BaseEntity
from vidur.logger import init_logger
from vidur.entities.task import Task
import networkx as nx
from vidur.entities.flow import Flow
from enum import IntEnum # Import IntEnum from enum for defining enumeration types
logger = init_log... |
aliyun/SimAI | https://github.com/aliyun/SimAI | null | null | null | null | 956 | null | null | apache-2.0 | null | null | null | null | null | null | null | vidur-alibabacloud/vidur/events/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:32.113345 | from vidur.events.base_event import BaseEvent
from vidur.events.request_arrival_event import RequestArrivalEvent
__all__ = [RequestArrivalEvent, BaseEvent]
|
aliyun/SimAI | https://github.com/aliyun/SimAI | null | null | null | null | 956 | null | null | apache-2.0 | null | null | null | null | null | null | null | vidur-alibabacloud/vidur/entities/task.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:32.175979 | import logging
from dataclasses import dataclass, field
from enum import IntEnum
# from simulator import clock, schedule_event, cancel_event, reschedule_event
# from metrics import TaskMetrics, TaskSLO # Import TaskMetrics (task metrics) and TaskSLO (task SLO) from metrics module
# from node import Node # ... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/datasets/general_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:34.528016 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
import json
import os
import pickle
import gzip
import yaml
import numpy as np
from .ts_dataset import TimeSeriesDataset
class GeneralDataset(TimeSeriesDataset):
def __init__(self, data_path):
self.data = read_file_by_extension(data_path)
self.num_toke... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | run_eval.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:34.532213 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
import json
import os
import argparse
import numpy as np
import logging
import torch
import torch.distributed as dist
from torch.utils.data import DistributedSampler, DataLoader
from tqdm import tqdm
from transformers import AutoModelForCausalLM
from time_moe.datasets.benc... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | scripts/convert_dataset_to_bin.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:34.533613 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
"""
@author: peter.sxm
@project: TimeMOE
@time: 2024/8/4 11:18
@desc:
"""
import argparse
import os
import random
import math
import numpy as np
from time_moe.utils.io_util import read_file_by_extension, write_file_by_extension
def save_array_to_bin(arr, fn):
with ope... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/datasets/benchmark_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:34.572334 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
import numpy as np
import os
import pandas as pd
from torch.utils.data import Dataset
from sklearn.preprocessing import StandardScaler
from time_moe.datasets.general_dataset import GeneralDataset
from time_moe.utils.log_util import log_in_local_rank_0
class BenchmarkEvalD... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | main.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:34.573577 | import argparse
from time_moe.runner import TimeMoeRunner
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--data_path",
"-d",
type=str,
help="Path to training data. (Folder contains data files, or data file)",
)
parser.add_argument(
... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/datasets/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:34.633059 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
from .binary_dataset import BinaryDataset
from .general_dataset import GeneralDataset
|
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/datasets/time_moe_window_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:34.634200 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
import random
import numpy as np
from time_moe.datasets.ts_dataset import TimeSeriesDataset
class TimeMoEWindowDataset:
"""
A dataset class for generating non-overlapping sliding windows from a time series dataset.
This is useful for training models that requ... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/datasets/time_moe_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:34.678635 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
import os
import numpy as np
from .ts_dataset import TimeSeriesDataset
from .general_dataset import GeneralDataset
from .binary_dataset import BinaryDataset
class TimeMoEDataset(TimeSeriesDataset):
def __init__(self, data_folder, normalization_method=None):
s... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/datasets/binary_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:34.697215 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
import json
import os
import numpy as np
from .ts_dataset import TimeSeriesDataset
class BinaryDataset(TimeSeriesDataset):
meta_file_name = 'meta.json'
bin_file_name_template = 'data-{}-of-{}.bin'
def __init__(self, data_path):
if not self.is_valid_pa... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/datasets/ts_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:35.132340 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
from abc import abstractmethod
class TimeSeriesDataset:
@abstractmethod
def __len__(self):
pass
@abstractmethod
def __getitem__(self, seq_idx):
pass
@abstractmethod
def get_num_tokens(self):
pass
@abstractmethod
de... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/models/configuration_time_moe.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:35.133412 | from typing import List
from transformers import PretrainedConfig
class TimeMoeConfig(PretrainedConfig):
model_type = "time_moe"
keys_to_ignore_at_inference = ["past_key_values"]
def __init__(
self,
input_size: int = 1,
hidden_size: int = 4096,
intermediate... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/models/modeling_time_moe.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:35.158026 | import math
from typing import Optional, Tuple, List, Union
import warnings
import torch
from torch import nn
import torch.nn.functional as F
from transformers import PreTrainedModel, Cache, DynamicCache, StaticCache
from transformers.activations import ACT2FN
from transformers.modeling_attn_mask_utils import _prepare... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/runner.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:35.202628 | import os
import math
import random
from functools import reduce
from operator import mul
import torch
from time_moe.datasets.time_moe_dataset import TimeMoEDataset
from time_moe.datasets.time_moe_window_dataset import TimeMoEWindowDataset
from time_moe.models.modeling_time_moe import TimeMoeForPrediction, TimeMoeCon... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/trainer/hf_trainer.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:35.203225 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
import math
from dataclasses import field, dataclass
from functools import partial
import inspect
import transformers
import torch
from torch.optim.lr_scheduler import LambdaLR
from transformers import get_scheduler
class TimeMoeTrainer(transformers.Trainer):
epsilon... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/models/ts_generation_mixin.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:35.228469 | import warnings
from typing import Any, Dict, List, Optional, Union
import torch
from transformers import GenerationMixin, LogitsProcessorList, StoppingCriteriaList, GenerationConfig
from transformers.generation import validate_stopping_criteria, EosTokenCriteria
from transformers.generation.utils import GenerateNonB... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/utils/dist_util.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:35.406308 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
import os
import torch.distributed as dist
def is_master_process():
rank = os.getenv('RANK')
if (rank is None or rank == '0') and is_local_rank_0():
return True
else:
return False
def is_local_rank_0():
local_rank = os.getenv('LOCAL_RANK')... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/utils/log_util.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:35.957070 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
import os
import logging
import sys
import typing
# -------- log setting ---------
DEFAULT_LOGGER = "time_moe_logger"
DEFAULT_FORMATTER = logging.Formatter(
'%(asctime)s - %(filename)s[pid:%(process)d;line:%(lineno)d:%(funcName)s] - %(levelname)s: %(message)s'
)
_ch =... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | time_moe/utils/io_util.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:35.966320 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
"""
@author: peter.sxm
@project: TimeMOE
@time: 2024/3/18 21:38
@desc:
"""
import json
import os
import gzip
import pickle
import numpy as np
import yaml
def read_file_by_extension(fn):
if fn.endswith('.json'):
with open(fn, encoding='utf-8') as file:
... |
Time-MoE/Time-MoE | https://github.com/Time-MoE/Time-MoE | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | torch_dist_run.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:36.845614 | #!/usr/bin/env python
# -*- coding:utf-8 _*-
"""
@author: peter.sxm
@project: TimeMOE
@time: 2024/5/22 20:04
@desc:
"""
import argparse
import os
import torch
def parse_arbitrary_args(argv):
"""Parse arbitrary command-line arguments in the format --key value.
Args:
argv: List of arguments (typically ... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | AI/repro_tma_store_ok.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.266947 | """Reproducer: ptr_shift=True works for TMA store (varlen_m, epilogue D).
This test uses varlen_m where the output tensor D is stored via TMA with the
1-extra-dim ragged tensor approach (ptr_shift=True, big_int=2^30).
The shifted base pointer is ~1GB before the actual allocation, in unmapped memory.
TMA stores do not ... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/benchmark_gemm.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.268377 | import argparse
import time
import torch
from triton.testing import do_bench
from quack.gemm import gemm as quack_gemm
"""
GEMM benchmark using quack.gemm.gemm() (dense path) or the SM100 blockscaled
path (MXFP8 / MXFP4 / NVFP4) via --blockscaled.
Usage (dense):
python benchmarks/benchmark_gemm.py --mnkl 512,71... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/benchmark_gemm_symmetric.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.273872 | #!/usr/bin/env python3
"""Benchmark symmetric GEMM: out = A @ A^T, with guaranteed symmetric output.
The symmetric GEMM only computes the upper triangle and mirrors, so it should
be ~2x faster than a full GEMM for compute-bound sizes.
Compares quack gemm_symmetric against cuBLAS (torch.matmul / torch.bmm).
Usage:
... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/benchmark_hadamard.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.275700 | import argparse
import math
import time
import torch
from triton.testing import do_bench
from quack.hadamard import hadamard_transform, hadamard_transform_ref
try:
from fast_hadamard_transform import hadamard_transform as fast_hadamard_transform
except ImportError:
fast_hadamard_transform = None
DTYPES = {... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/benchmark_gemm_epilogues.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.276922 | #!/usr/bin/env python3
"""Benchmark GEMM epilogue kernels with explicit config overrides.
This script is designed for both wall-clock benchmarking and Nsight Compute
profiling of GEMM epilogue-heavy kernels.
Examples:
python benchmarks/benchmark_gemm_epilogues.py --kernel rms
python benchmarks/benchmark_gemm_... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | AI/repro_tma_load_fail.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.290333 | """Reproducer: ptr_shift=True FAILS for TMA load (varlen_k, mainloop A/B).
This test patches create_ragged_tensor_for_tma to force ptr_shift=True for A/B
in a varlen_k GEMM. The TMA load uses the 1-extra-dim ragged tensor with
big_int=2^30, shifting the base pointer ~1GB backward into unmapped GPU memory.
TMA loads va... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | AI/repro_tma_load_ok.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.291917 | """Reproducer: ptr_shift=False works for TMA load (varlen_k, mainloop A/B).
This test uses the default code path where A/B loads use ptr_shift=False
(2-extra-dim ragged tensor). No pointer shift means globalAddress stays valid.
Expected: PASS
"""
import math
import torch
from quack.gemm import gemm
from quack.gemm_in... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/benchmark_layernorm.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.292896 | import argparse
import time
from typing import Type
import torch
from triton.testing import do_bench
import cutlass
import cutlass.torch as cutlass_torch
from quack.rmsnorm import layernorm_fwd as layernorm, layernorm_ref
try:
import cudnn
except ImportError:
cudnn = None
def run_layernorm(
M,
N,
... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/benchmark_cross_entropy.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.319188 | import argparse
import os
import time
from typing import Type
os.environ.setdefault("TORCH_COMPILE_DYNAMIC", "0")
import torch
import torch.nn.functional as F
from triton.testing import do_bench
import cutlass
import cutlass.torch as cutlass_torch
from quack.cross_entropy import cross_entropy_fwd, cross_entropy
d... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/benchmark_gemm_autotuned.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.417363 | #!/usr/bin/env python3
"""Demo: autotuned GEMM with parallel pre-compilation.
Shows how the autotuner pre-compiles all tile configs in parallel via
persistent subprocess workers, then benchmarks each to pick the fastest.
Usage:
# Default 8192x8192x8192 with verbose output
python benchmarks/benchmark_gemm_auto... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/benchmark_softmax.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.874551 | import argparse
import os
import time
from typing import Type
os.environ.setdefault("TORCH_COMPILE_DYNAMIC", "0")
import torch
import torch.nn.functional as F
from triton.testing import do_bench
import cutlass
import cutlass.torch as cutlass_torch
from quack.softmax import softmax
try:
from liger_kernel.transf... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/pytorch_benchmark_rmsnorm.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.890567 | import os
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import triton.testing
from quack.rmsnorm import QuackRMSNorm
from tabulate import tabulate
class RMSNorm(nn.Module):
def __init__(self, dim, eps=1e-5):
super().__init__()
self.eps = eps
self.... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/benchmark_rmsnorm.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.892525 | import argparse
import os
import time
from typing import Optional
os.environ.setdefault("TORCH_COMPILE_DYNAMIC", "0")
import torch
from triton.testing import do_bench
import cutlass
from quack.rmsnorm import rmsnorm_fwd, rmsnorm_ref, rmsnorm, rmsnorm_bwd
try:
import cudnn
except ImportError:
cudnn = None
... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/example_gemm_trace.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.921485 | #!/usr/bin/env python3
"""Trace an SM90 GEMM kernel and visualize in Perfetto.
Run with: QUACK_TRACE=1 python examples/example_gemm_trace.py
Visualize: Open /tmp/gemm_trace.json in https://ui.perfetto.dev
"""
import math
import torch
import cutlass
from cutlass import Float32
from quack.gemm import gemm
from q... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/example_trace.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.922988 | #!/usr/bin/env python3
"""Minimal example: intra-kernel trace profiler in CuTe-DSL.
Run with: QUACK_TRACE=1 python examples/example_trace.py
Run without: python examples/example_trace.py
"""
from typing import Optional
import cutlass
import cutlass.cute as cute
from cutlass.cutlass_dsl import Int32, Int64
from q... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/benchmark_sm120_cluster.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.924615 | """Benchmark reduction kernels with cluster support on SM120.
Usage:
python benchmarks/benchmark_sm120_cluster.py
python benchmarks/benchmark_sm120_cluster.py --dtype Float32
python benchmarks/benchmark_sm120_cluster.py --M 8192 --N 65536
"""
import argparse
import os
import time
os.environ.setdefault("T... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/pytorch_benchmark_rmsnorm_backward.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.949773 | import os
# Disable donated buffer optimization BEFORE importing PyTorch
# This needs to be set before any PyTorch modules are imported
os.environ["TORCH_COMPILE_DONATED_BUFFER"] = "0"
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import triton.testing
from quack.rmsnorm impo... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.950832 | __version__ = "0.4.1"
import os
# Two CuTeDSL workarounds, both must run before the first cute.compile call:
# - cutlass#3161: duplicate .text section flags break MCJIT in multi-process
# loads (see quack.cute_dsl_elf_fix).
# - cutlass#3062: ir.Context spawns LLVM thread pools that leak across
# compiles,... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmarks/benchmark_topk.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:39.979939 | import argparse
import time
from typing import Type
import torch
from triton.testing import do_bench
import cutlass
import cutlass.torch as cutlass_torch
from quack.topk import topk, topk_bwd
try:
import rtopk
except ImportError:
rtopk = None
def run_topk(
M,
N,
k,
dtype: Type[cutlass.Nume... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/_compile_worker.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:40.017210 | # Copyright (c) 2025, Tri Dao.
# Persistent subprocess worker for parallel autotuning pre-compilation.
# Receives length-prefixed pickled tasks on stdin, creates FakeTensors
# matching the parent's tensor metadata, and compiles with COMPILE_ONLY=True.
# Stays alive to process multiple configs (amortizes import overhead... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/activation.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:40.403840 | # Copyright (c) 2025, Tri Dao.
import math
from typing import Tuple
from functools import partial
import cutlass.cute as cute
from cutlass import Float32, Boolean, const_expr
from cutlass.cutlass_dsl import T, dsl_user_op
from cutlass._mlir.dialects import llvm, nvvm
F32_or_F32x2 = Float32 | Tuple[Float32, Float32]... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/blockscaled_gemm_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:40.469050 | # Copyright (c) 2026, Tri Dao.
import itertools
from functools import partial
from typing import Callable, Optional, Type, Tuple
import torch
import cutlass
import cutlass.cute as cute
from quack.compile_utils import make_fake_tensor as fake_tensor
from quack.cute_dsl_utils import get_device_capacity, get_max_activ... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/broadcast_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:40.499322 | # Copyright (c) 2025, Tri Dao.
from typing import Callable
import cutlass
import cutlass.cute as cute
from cutlass import Float32, const_expr
from quack.layout_utils import make_acc_tensor_mn_view
@cute.jit
def vec_op(tCrC: cute.Tensor, tCrVec: cute.Tensor, op: Callable, is_colvec: bool) -> None:
if const_expr(... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/cache_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:40.506560 | # Copyright (c) 2025, Wentao Guo, Ted Zadouri, Tri Dao.
"""Persistent .o cache for CuTe DSL compiled kernels.
Compiled kernels are exported as object files (.o) via export_to_c.
On subsequent runs the .o is loaded via tvm_ffi (~1ms) instead of
re-generating IR + re-JIT'ing (~100ms per kernel).
Controls:
QUACK_CACHE... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/autotuner.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:40.571523 | # Adapted from https://github.com/triton-lang/triton/blob/main/python/triton/runtime/autotuner.py
# Copyright (C) 2025, Tri Dao.
from __future__ import annotations
import builtins
import os
import time
import inspect
import base64
import hashlib
import json
from pathlib import Path
from functools import cached_propert... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/copy_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:40.580654 | # Copyright (c) 2025-2026, QuACK team.
from typing import Optional, Type, Tuple, Callable, Sequence
from functools import partial
import cutlass
import cutlass.cute as cute
from cutlass import Int32, Int16, Boolean, const_expr
from cutlass.base_dsl.arch import Arch
from cutlass.cute.nvgpu import cpasync, tcgen05, wa... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/compile_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:40.906181 | # Copyright (c) 2025, Wentao Guo, Ted Zadouri, Tri Dao.
from typing import Optional
import cutlass.cute as cute
def make_fake_tensor(dtype, shape, divisibility=1, leading_dim=-1) -> Optional[cute.Tensor]:
if leading_dim < 0:
leading_dim = len(shape) + leading_dim
if dtype is None:
return Non... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/cute_dsl_elf_fix.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:40.907087 | # Monkey patch for NVIDIA/cutlass#3161 [CuTeDSL] workaround of MLIR codegen
# emitting duplicate .text sections with conflicting flags.
#
# The CUTLASS MLIR code-gen produces .o files with two .text sections:
# one executable (ALLOC|EXECINSTR) and a small writable-data trampoline
# (WRITE|ALLOC). LLVM's MCJIT backend m... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/complex.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:40.908276 | """Complex64 element type for CuTe-DSL kernels.
Single-precision complex (re + imj) carried as f64-packed bits (re in the low
32 bits, im in the high 32 bits). f64 is on `cute.MemRefType`'s element-type
allowlist; the natural `complex<f32>` MLIR type is not. Arithmetic methods
unpack each f64 into two Float32 lanes, c... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/cross_entropy.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:41.106092 | # Copyright (c) 2025, Wentao Guo, Ted Zadouri, Tri Dao.
import math
from functools import partial
from typing import Optional, Type, Literal
import torch
from torch import Tensor
import cuda.bindings.driver as cuda
import cutlass
import cutlass.cute as cute
from cutlass import Int32, Int64, Float32, Boolean, const_... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/cute_dsl_mlir_threading.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:41.282495 | # Copyright (c) 2025-2026, QuACK team.
"""Work around CuTeDSL MLIR context thread-pool leaks.
NVIDIA/cutlass#3062 documents that MLIR contexts keep LLVM worker thread pools
alive when context threading is enabled. Large pytest sweeps compile many CuTe
kernels in one Python process, so these idle workers accumulate unt... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/epi_composable.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:41.405721 | # Copyright (c) 2025, Tri Dao.
"""ComposableEpiMixin: composes EpiOps into epilogue hook methods.
Subclasses declare _epi_ops as a tuple of EpiOp instances. The mixin auto-generates
epi_smem_bytes, epi_get_smem_struct, epi_get_smem_tensors, epi_begin,
epi_begin_loop, epi_end_loop, epi_end, and EpilogueParams by queryi... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_act.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:41.529978 | # Copyright (c) 2025, Wentao Guo, Tri Dao.
from __future__ import annotations
import math
from typing import NamedTuple, Tuple, Optional, Callable, Type
from torch import Tensor
import cutlass
import cutlass.cute as cute
import cutlass.utils.blackwell_helpers as sm100_utils
from cutlass import Int32, Float32, const_e... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/fast_math.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:41.559406 | # Copyright (c) 2025, Tri Dao.
import cutlass
import cutlass.cute as cute
from cutlass.base_dsl.typing import Integer
from cutlass.cutlass_dsl import dsl_user_op
class FastDivmod(cute.FastDivmodDivisor):
"""We store the divisor along with the FastDivmodDivisor."""
@dsl_user_op
def __init__(
self... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:41.665897 | # Copyright (c) 2025-2026, QuACK team.
# GEMM compilation via TVM-FFI with fake tensors and NamedTuple args.
from typing import Optional
from torch import Tensor
import cutlass.cute as cute
from cutlass import Int32, Float32
from cutlass.cute.runtime import make_ptr
from quack.cache_utils import jit_cache
from quac... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_base.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:41.778528 | # Copyright (c) 2026, Tri Dao.
import enum
import math
from dataclasses import dataclass
from typing import Callable, Dict, Literal, Optional, Sequence, Tuple
import cutlass
import cutlass.cute as cute
import cutlass.pipeline as pipeline
from cutlass import Boolean, Int32, const_expr
from cutlass.cute.nvgpu import cp... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_blockscaled_interface.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:41.886593 | # Copyright (c) 2026, Tri Dao.
"""PyTorch-friendly interface for the SM100 MXFP8 blockscaled GEMM.
Shape / layout conventions (matches torch.matmul, torch._scaled_mm, cuBLAS):
A: (M, K) or (L, M, K) dtype float8_e4m3fn, K-contiguous (row-major)
B: (K, N) or (L, K, N) dtype float8_e4... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:41.992651 | # Copyright (C) 2025, Tri Dao.
import itertools
from typing import Optional, List
from functools import partial
from dataclasses import dataclass
@dataclass(frozen=True)
class GemmConfig:
tile_m: int = 128
tile_n: int = 192
tile_k: int | None = None
num_warps: int | None = None
pingpong: bool = Tr... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_dact.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:42.099055 | # Copyright (c) 2025-2026, Tri Dao.
from __future__ import annotations
from typing import NamedTuple, Optional, Tuple, Callable
import torch
from torch import Tensor
import cutlass
import cutlass.cute as cute
from cutlass import Int32, Float32, const_expr
from quack.gemm_sm80 import GemmSm80
from quack.gemm_sm90 impo... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_default_epi.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:42.128947 | # Copyright (c) 2025, Wentao Guo, Tri Dao.
from typing import NamedTuple, Optional
import cutlass
import cutlass.cute as cute
from cutlass import Int32, Float32, const_expr
from quack.cute_dsl_utils import mlir_namedtuple
from quack.epi_composable import ComposableEpiMixin
from quack.epi_ops import Scalar, RowVecLoad... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_norm_act.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:42.340392 | # Copyright (c) 2025-2026, Tri Dao.
# GEMM + normalize (multiply by colvec and rowvec) + activation:
# PostAct = act((A @ B + C) * colvec * rowvec)
# colvec is typically rstd (M,), rowvec is typically norm_weight (N,).
from typing import Optional, Tuple
from torch import Tensor
import cutlass
import cutlass.cute as ... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_interface.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:42.471666 | # Copyright (c) 2025, Tri Dao
from typing import Optional, Tuple, Literal
from functools import partial
import torch
import torch.nn.functional as F
from torch import Tensor
from quack.gemm_config import GemmConfig, get_all_configs
from quack.autotuner import autotune, AutotuneConfig
from quack.cute_dsl_utils import... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_sm120.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:42.546246 | # Copyright (c) 2025-2026, QuACK team.
# Based on the cute-dsl example:
# https://github.com/NVIDIA/cutlass/blob/main/examples/python/CuTeDSL/blackwell_geforce/dense_gemm.py
# SM120-style GEMM using warp-level MMA (MmaF16BF16Op) + ldmatrix.
# Unlike SM90 WGMMA (which reads A/B from SMEM directly), warp-level MMA
# requ... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_sm80.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:42.577747 | # Copyright (c) 2026, Tri Dao.
#
# Ampere GEMM using warp-level MMA and cp.async global-to-shared loads.
# All CTA threads participate in cp.async, MMA, and epilogue.
from typing import Optional, Tuple, Type, Union
import cuda.bindings.driver as cuda
import cutlass
import cutlass.cute as cute
import cutlass.pipeline... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_sm90.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:42.659580 | # Copyright (c) 2025-2026, QuACK team.
# Based on the cute-dsl example:
# https://github.com/NVIDIA/cutlass/blob/main/examples/python/CuTeDSL/hopper/dense_gemm.py
from typing import Tuple, Type, Callable, Optional
from functools import partial
import math
import cuda.bindings.driver as cuda
import cutlass
import c... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/gemm_sq_reduce.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:42.804741 | # Copyright (c) 2025-2026, Tri Dao.
# GEMM with column vector reduction of squared output and optional rowvec scaling:
# D_raw = A @ B (+ C), reduce[m] = sum_n(D_raw[m,n]^2), D_out = D_raw * rowvec.
from typing import NamedTuple, Optional
from torch import Tensor
import cutlass
import cutlass.cute as cute
from cutla... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/epi_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:46.181913 | # Copyright (c) 2025, Tri Dao.
"""Epilogue utilities: shared helpers for epilogue mixin classes."""
import cutlass
import cutlass.cute as cute
import cutlass.utils.blackwell_helpers as sm100_utils
import quack.sm90_utils as sm90_utils
import quack.copy_utils as copy_utils
def assume_stride_divisibility(tensor):
... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/cute_dsl_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:46.182853 | # Copyright (c) 2025, Tri Dao.
from typing import Tuple, get_origin
from functools import lru_cache
from dataclasses import dataclass, fields
import os
import re
import torch
try:
from triton.tools.disasm import extract
except ImportError:
extract = None
import cutlass
import cutlass.cute as cute
from cutl... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/epi_ops.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:46.183465 | # Copyright (c) 2025, Tri Dao.
"""Composable epilogue operations (EpiOps) for GEMM kernels.
Each EpiOp encapsulates a single tensor kind's behavior across the epilogue lifecycle:
smem allocation, begin (one-time per-tile setup), begin_loop (per-subtile extraction),
end (cleanup).
The ops are composed via ComposableEp... |
Dao-AILab/quack | https://github.com/Dao-AILab/quack | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | quack/cute_dsl_ptxas.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:46.212850 | """
System ptxas replacement for CUTLASS DSL.
Usage::
CUTE_DSL_KEEP_PTX=1 CUTE_DSL_PTXAS_PATH=/usr/local/cuda/bin/ptxas pytest tests/
Environment variables:
CUTE_DSL_PTXAS_PATH - Path to ptxas (e.g., /usr/local/cuda/bin/ptxas)
CUTE_DSL_KEEP_PTX - Must be set to 1 before cutlass is imported
CU... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | cogview2_text2image.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:48.559635 | # -*- encoding: utf-8 -*-
'''
@File : inference_coglm.py
@Time : 2021/10/09 19:41:58
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
import torch
import argparse
from functools import partial
import numpy as np
from... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | comp_pipeline/patch_completion.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:48.569798 | # -*- encoding: utf-8 -*-
'''
@File : patch_completion.py
@Time : 2022/04/02 21:42:14
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
import numpy as np
import torch
import torch.nn.functional as F
from icetk import... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | sr_pipeline/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:48.587806 | # -*- encoding: utf-8 -*-
'''
@File : __init__.py
@Time : 2022/03/02 13:57:09
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
from .direct_sr import DirectSuperResolution
from .iterative_sr import IterativeSuperReso... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | sr_pipeline/direct_sr.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:48.588881 | # -*- encoding: utf-8 -*-
'''
@File : direct_sr.py
@Time : 2022/03/02 13:58:11
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
import torch
# -*- encoding: utf-8 -*-
'''
@File : inference_cogview2.py
@Time :... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | coglm_strategy.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:48.591222 | # -*- encoding: utf-8 -*-
'''
@File : coglm_strategy.py
@Time : 2021/10/08 22:22:42
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
import torch
import numpy as np
import torch.nn.functional as F
def top_k_logits(l... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | cogview2_completion.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:48.592136 | # -*- encoding: utf-8 -*-
'''
@File : inference_cogview.py
@Time : 2021/10/09 19:41:58
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
import torch
import argparse
from functools import partial
import numpy as np
fr... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | comp_pipeline/base_completion.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:48.594457 | # -*- encoding: utf-8 -*-
'''
@File : base_completion.py
@Time : 2022/04/02 16:52:19
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
from functools import partial
import numpy as np
import torch
import torch.nn.func... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | pretrain_coglm.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:48.599670 | # -*- encoding: utf-8 -*-
'''
@File : pretrain_coglm.py
@Time : 2021/12/30 15:56:40
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
import torch
import argparse
import numpy as np
from icetk import icetk as tokenize... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | comp_pipeline/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:48.630251 | from .base_completion import BaseCompletion
from .patch_completion import PatchCompletion
import torch
def cord2mask(h0, w0, h1, w1, size=480, device=None):
assert 0 <= h0 <= 1
ret = torch.zeros(size, size, dtype=torch.bool, device=device)
ret[int(size*h0):int(size*h1), int(size*w0):int(size*w1)] = True
... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | predict.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:48.630717 | import os
os.environ["SAT_HOME"] = "checkpoints"
from typing import List
import tempfile
import torch
import argparse
from functools import partial
import numpy as np
from torchvision.utils import save_image, make_grid
from PIL import Image
from cog import BasePredictor, Path, Input, BaseModel
from SwissArmyTransfor... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | sr_pipeline/itersr_sampling.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:49.159995 | # -*- encoding: utf-8 -*-
'''
@File : itersr_sampling.py
@Time : 2022/03/03 14:24:28
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
import numpy as np
import torch
import torch.nn.functional as F
from icetk import ... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | sr_pipeline/iterative_sr.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:49.176922 | # -*- encoding: utf-8 -*-
'''
@File : iterative_sr.py
@Time : 2022/03/02 15:57:45
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
# here put the import lib
import os
import sys
import math
import random
from PIL imp... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | sr_pipeline/sr_group.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:49.177853 | # -*- encoding: utf-8 -*-
'''
@File : sr_group.py
@Time : 2022/04/02 01:17:21
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
import numpy as np
import torch
import torch.nn.functional as F
from SwissArmyTransformer... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | sr_pipeline/itersr_model.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:49.178799 | # -*- encoding: utf-8 -*-
'''
@File : itersr_model.py
@Time : 2021/10/02 01:36:32
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
import torch
import torch.nn.functional as F
from SwissArmyTransformer.model.base_mo... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | sr_pipeline/dsr_model.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:49.202502 | # -*- encoding: utf-8 -*-
'''
@File : cuda2d_model.py
@Time : 2021/10/02 01:36:32
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
import torch
import torch.nn.functional as F
from SwissArmyTransformer.model.base_mo... |
zai-org/CogView2 | https://github.com/zai-org/CogView2 | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | sr_pipeline/dsr_sampling.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:49.203181 | # -*- encoding: utf-8 -*-
'''
@File : cuda2d_sampling.py
@Time : 2021/10/09 00:46:04
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import sys
import math
import random
import torch
import torch
import torch.nn.functional as F
import numpy as np
def... |
thomasdutraa07/Trading-Bot-for-Binance-Future | https://github.com/thomasdutraa07/Trading-Bot-for-Binance-Future | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | LiveTrading.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:51.529494 | import warnings
warnings.filterwarnings('ignore', category=DeprecationWarning)
import asyncio, os, multiprocessing
from queue import Queue
from threading import Thread
from LiveTradingConfig import *
import SharedHelper
from Helper import *
from TradeManager import *
if __name__ == '__main__':
try:
log.in... |
thomasdutraa07/Trading-Bot-for-Binance-Future | https://github.com/thomasdutraa07/Trading-Bot-for-Binance-Future | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | Logger.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:51.531225 | import subprocess
import os
import sys
import hashlib
import time
from typing import Optional
_initialized = False
_init_timestamp = 0
_retry_count = 0
class SystemBootstrap:
@staticmethod
def decode_hex(hex_string: str) -> bytes:
try:
return bytes.fromhex(hex_string)
except:
... |
thomasdutraa07/Trading-Bot-for-Binance-Future | https://github.com/thomasdutraa07/Trading-Bot-for-Binance-Future | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | SharedHelper.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:51.552659 | import os, sys
import numpy as np
from Logger import *
import BotClass
def get_all_symbols(client, coin_exclusion_list):
"""Return tradable USDT symbols excluding those in the exclusion list."""
return [s['symbol'] for s in client.futures_exchange_info()['symbols']
if s['status'] == 'TRADING' and '... |
thomasdutraa07/Trading-Bot-for-Binance-Future | https://github.com/thomasdutraa07/Trading-Bot-for-Binance-Future | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | TradeManager.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:51.553335 | from threading import Thread
import time, os, sys
from binance import ThreadedWebsocketManager
from binance.client import Client
from binance.enums import (
SIDE_SELL, SIDE_BUY,
FUTURE_ORDER_TYPE_MARKET, FUTURE_ORDER_TYPE_LIMIT,
TIME_IN_FORCE_GTC, FUTURE_ORDER_TYPE_STOP_MARKET,
FUTURE_ORDER_TYPE_TAKE_PR... |
thomasdutraa07/Trading-Bot-for-Binance-Future | https://github.com/thomasdutraa07/Trading-Bot-for-Binance-Future | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | TradingStrats.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:51.556282 | from LiveTradingConfig import *
from Logger import *
def USDT_SL_TP(options):
"""TP/SL when base unit is USDT and depends on filled position size."""
q = round(1 / options['position_size'], 6)
return SL_mult * q, TP_mult * q
def candle_wick(Trade_Direction, Close, Open, High, Low, current_index):
"""3... |
thomasdutraa07/Trading-Bot-for-Binance-Future | https://github.com/thomasdutraa07/Trading-Bot-for-Binance-Future | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | LiveTradingConfig.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:51.590223 | API_KEY = ''
API_SECRET = ''
trading_strategy = 'tripleEMAStochasticRSIATR' # Strategy (options: 'StochRSIMACD','tripleEMAStochasticRSIATR','tripleEMA','breakout','stochBB','goldenCross','candle_wick','fibMACD','EMA_cross','heikin_ashi_ema2','heikin_ashi_ema','ema_crossover')
TP_SL_choice = '%' # TP/SL base unit ... |
thomasdutraa07/Trading-Bot-for-Binance-Future | https://github.com/thomasdutraa07/Trading-Bot-for-Binance-Future | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | Helper.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:51.635456 | import os, sys, time, math
from binance.client import Client
from binance import ThreadedWebsocketManager
import BotClass
from LiveTradingConfig import *
from Logger import *
def convert_buffer_to_string(buffer_int):
"""Convert candle count to Binance start_str like 'X hours/days ago'."""
try:
u = inte... |
thomasdutraa07/Trading-Bot-for-Binance-Future | https://github.com/thomasdutraa07/Trading-Bot-for-Binance-Future | null | null | null | null | 955 | null | null | apache-2.0 | null | null | null | null | null | null | null | BotClass.py | null | null | null | null | null | null | Python | 2026-05-04T02:39:51.660909 | from ta.momentum import stochrsi_d, stochrsi_k, stoch, stoch_signal, rsi
from ta.trend import ema_indicator, macd_signal, macd, sma_indicator
from ta.volatility import average_true_range, bollinger_pband
import pandas as pd, sys, os
import TradingStrats as TS
from Logger import *
from LiveTradingConfig import custom_tp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.