repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_2d/test_2d.py
tests/test_legacy/test_layers/test_2d/test_2d.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import pytest import torch from checks_2d.check_layer_2d import ( check_classifier_given_embed_weight, check_classifier_no_given_weight, check_embed, check_layernorm, check_linear, check_loss, check_patch_embed, check_vocab_parallel_classi...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_2d/checks_2d/common.py
tests/test_legacy/test_layers/test_2d/checks_2d/common.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import torch DEPTH = 2 BATCH_SIZE = 8 SEQ_LENGTH = 8 HIDDEN_SIZE = 8 NUM_CLASSES = 8 VOCAB_SIZE = 16 IMG_SIZE = 16 def check_equal(A, B): assert torch.allclose(A, B, rtol=1e-3, atol=1e-2)
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_2d/checks_2d/check_operation_2d.py
tests/test_legacy/test_layers/test_2d/checks_2d/check_operation_2d.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import torch from colossalai.accelerator import get_accelerator from colossalai.legacy.context.parallel_mode import ParallelMode from colossalai.legacy.core import global_context as gpc from colossalai.legacy.nn.layer.parallel_2d._operation import Matmul_AB_2D, Matmul_A...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_2d/checks_2d/check_layer_2d.py
tests/test_legacy/test_layers/test_2d/checks_2d/check_layer_2d.py
import torch from colossalai.accelerator import get_accelerator from colossalai.legacy.context.parallel_mode import ParallelMode from colossalai.legacy.core import global_context as gpc from colossalai.legacy.nn import ( Classifier2D, CrossEntropyLoss2D, Embedding2D, LayerNorm2D, Linear2D, Patc...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_2d/checks_2d/__init__.py
tests/test_legacy/test_layers/test_2d/checks_2d/__init__.py
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_3d/test_3d.py
tests/test_legacy/test_layers/test_3d/test_3d.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import pytest import torch from checks_3d.check_layer_3d import ( check_classifier_no_given_weight, check_embed, check_layernorm, check_linear, check_loss, check_patch_embed, check_vocab_parallel_classifier_given_embed_weight, check_vocab_p...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_3d/checks_3d/check_layer_3d.py
tests/test_legacy/test_layers/test_3d/checks_3d/check_layer_3d.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import time import torch from colossalai.accelerator import get_accelerator from colossalai.legacy.constants import INPUT_GROUP_3D, OUTPUT_GROUP_3D, WEIGHT_GROUP_3D from colossalai.legacy.core import global_context from colossalai.legacy.nn import ( Classifier3D, ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
true
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_3d/checks_3d/common.py
tests/test_legacy/test_layers/test_3d/checks_3d/common.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import torch DEPTH = 2 BATCH_SIZE = 8 SEQ_LENGTH = 8 HIDDEN_SIZE = 8 NUM_CLASSES = 8 NUM_BLOCKS = 2 IMG_SIZE = 16 VOCAB_SIZE = 16 def check_equal(A, B): eq = torch.allclose(A, B, rtol=1e-3, atol=1e-2) assert eq, f"\nA = {A}\nB = {B}" return eq
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_3d/checks_3d/__init__.py
tests/test_legacy/test_layers/test_3d/checks_3d/__init__.py
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_2p5d/test_2p5d.py
tests/test_legacy/test_layers/test_2p5d/test_2p5d.py
import pytest import torch from checks_2p5d.check_layer_2p5d import * from checks_2p5d.check_operation_2p5d import check_AB, check_ABT, check_ATB from colossalai.legacy.core import global_context as gpc from colossalai.legacy.initialize import launch from colossalai.logging import disable_existing_loggers from colossa...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_2p5d/checks_2p5d/common.py
tests/test_legacy/test_layers/test_2p5d/checks_2p5d/common.py
import torch TESSERACT_DIM = 2 TESSERACT_DEP = 2 BATCH_SIZE = 8 SEQ_LENGTH = 8 HIDDEN_SIZE = 8 NUM_CLASSES = 8 VOCAB_SIZE = 16 IMG_SIZE = 16 def check_equal(A, B): assert torch.allclose(A, B, rtol=1e-5, atol=1e-2)
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_2p5d/checks_2p5d/check_layer_2p5d.py
tests/test_legacy/test_layers/test_2p5d/checks_2p5d/check_layer_2p5d.py
import torch from torch.nn import Parameter from colossalai.accelerator import get_accelerator from colossalai.legacy.context.parallel_mode import ParallelMode from colossalai.legacy.core import global_context as gpc from colossalai.legacy.nn import ( Classifier2p5D, CrossEntropyLoss2p5D, Embedding2p5D, ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_2p5d/checks_2p5d/__init__.py
tests/test_legacy/test_layers/test_2p5d/checks_2p5d/__init__.py
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_layers/test_2p5d/checks_2p5d/check_operation_2p5d.py
tests/test_legacy/test_layers/test_2p5d/checks_2p5d/check_operation_2p5d.py
import torch from colossalai.accelerator import get_accelerator from colossalai.legacy.context import ParallelMode from colossalai.legacy.core import global_context as gpc from colossalai.legacy.nn.layer.parallel_2p5d._operation import Matmul_AB_2p5D, Matmul_ABT_2p5D, Matmul_ATB_2p5D from colossalai.legacy.utils impor...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_moe/moe_utils.py
tests/test_legacy/test_moe/moe_utils.py
import torch import torch.distributed as dist import torch.nn as nn from torch.distributed import ProcessGroup from colossalai.booster.plugin.low_level_zero_plugin import LowLevelZeroModel from colossalai.legacy.engine.gradient_handler._base_gradient_handler import BaseGradientHandler from colossalai.legacy.engine.gra...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_moe/test_moe_hybrid_zero.py
tests/test_legacy/test_moe/test_moe_hybrid_zero.py
import pytest import torch import torch.distributed as dist import colossalai from colossalai.booster import Booster from colossalai.booster.plugin import LowLevelZeroPlugin from colossalai.booster.plugin.low_level_zero_plugin import LowLevelZeroModel from colossalai.legacy.moe.manager import MOE_MANAGER from colossal...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_moe/test_grad_handler.py
tests/test_legacy/test_moe/test_grad_handler.py
import pytest import torch import torch.distributed as dist import torch.nn as nn import colossalai from colossalai.accelerator import get_accelerator from colossalai.legacy.moe.manager import MOE_MANAGER # from colossalai.shardformer.layer.moe.layers import SparseMLP from colossalai.testing import assert_equal_in_gr...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_moe/test_moe_load_balance.py
tests/test_legacy/test_moe/test_moe_load_balance.py
import pytest import torch import torch.distributed as dist import colossalai from colossalai.booster import Booster from colossalai.booster.plugin import LowLevelZeroPlugin from colossalai.booster.plugin.low_level_zero_plugin import LowLevelZeroModel from colossalai.legacy.moe.manager import MOE_MANAGER # from colos...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_moe/test_moe_group.py
tests/test_legacy/test_moe/test_moe_group.py
import pytest import torch.distributed as dist import torch.nn as nn import colossalai from colossalai.accelerator import get_accelerator from colossalai.legacy.moe.manager import MOE_MANAGER from colossalai.legacy.moe.utils import sync_moe_model_param # from colossalai.shardformer.layer.moe import MLPExperts from co...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_tensor/test_parameter.py
tests/test_legacy/test_tensor/test_parameter.py
import pytest import torch from common_utils import tensor_equal import colossalai from colossalai.tensor import ColoParameter, ColoTensor from colossalai.testing import free_port @pytest.mark.skip def test_multiinheritance(): colossalai.legacy.launch(rank=0, world_size=1, host="localhost", port=free_port(), bac...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_tensor/common_utils/__init__.py
tests/test_legacy/test_tensor/common_utils/__init__.py
from ._utils import *
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_tensor/common_utils/_utils.py
tests/test_legacy/test_tensor/common_utils/_utils.py
import os import random import numpy as np import torch import torch.distributed as dist from torch.testing import assert_close from colossalai.legacy.context import ParallelMode from colossalai.legacy.core import global_context as gpc from colossalai.legacy.tensor import ComputePattern, ComputeSpec, ShardSpec def ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_tensor/core/test_dist_spec_mgr.py
tests/test_legacy/test_tensor/core/test_dist_spec_mgr.py
import math import pytest import torch import torch.distributed as dist import colossalai from colossalai.legacy.tensor import DistSpecManager, ProcessGroup, ReplicaSpec, ShardSpec from colossalai.testing import rerun_if_address_is_in_use, spawn def run(): group = ProcessGroup(tp_degree=dist.get_world_size()) ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_engine/test_engine.py
tests/test_legacy/test_engine/test_engine.py
import pytest import torch import colossalai from colossalai.legacy.amp import AMP_TYPE from colossalai.legacy.core import global_context as gpc from colossalai.testing import DummyDataloader, parameterize, rerun_if_address_is_in_use, spawn from tests.kit.model_zoo import model_zoo CONFIG = dict( parallel=dict(pi...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_engine/test_gradient_accumluation.py
tests/test_legacy/test_engine/test_gradient_accumluation.py
import os from pathlib import Path import pytest import torch import torch.nn as nn from torch.optim import Adam from torchvision import transforms from torchvision.datasets import CIFAR10 from torchvision.models import resnet18 import colossalai from colossalai.legacy.core import global_context as gpc from colossala...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_context/test_hybrid_parallel.py
tests/test_legacy/test_context/test_hybrid_parallel.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- from pathlib import Path import torch from colossalai.legacy import launch from colossalai.legacy.context import reset_seeds from colossalai.legacy.context.parallel_mode import ParallelMode from colossalai.legacy.core import global_context as gpc from colossalai.legacy...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_context/configs/parallel_2p5d_init.py
tests/test_legacy/test_context/configs/parallel_2p5d_init.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- parallel = dict(pipeline=dict(size=2), tensor=dict(size=8, depth=2, mode="2.5d"))
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_context/configs/parallel_2d_init.py
tests/test_legacy/test_context/configs/parallel_2d_init.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- parallel = dict(pipeline=dict(size=2), tensor=dict(size=4, mode="2d"))
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_context/configs/parallel_3d_init.py
tests/test_legacy/test_context/configs/parallel_3d_init.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- parallel = dict(pipeline=dict(size=2), tensor=dict(size=8, mode="3d"))
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_data/test_deterministic_dataloader.py
tests/test_legacy/test_data/test_deterministic_dataloader.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import os from pathlib import Path import torch import torch.distributed as dist from torchvision import datasets, transforms import colossalai from colossalai.context import Config from colossalai.legacy.context import ParallelMode from colossalai.legacy.core import g...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_data/test_cifar10_dataset.py
tests/test_legacy/test_data/test_cifar10_dataset.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import os from pathlib import Path from torch.utils.data import DataLoader from torchvision import datasets, transforms def test_cifar10_dataset(): # build transform transform_pipeline = [transforms.ToTensor()] transform_pipeline = transforms.Compose(trans...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_data/test_data_parallel_sampler.py
tests/test_legacy/test_data/test_data_parallel_sampler.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import os from pathlib import Path import torch import torch.distributed as dist from torchvision import datasets, transforms import colossalai from colossalai.context import Config from colossalai.legacy.context import ParallelMode from colossalai.legacy.core import g...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_amp/test_torch_fp16.py
tests/test_legacy/test_amp/test_torch_fp16.py
import copy import pytest import torch import colossalai from colossalai.legacy.amp import convert_to_apex_amp, convert_to_torch_amp from colossalai.testing import assert_close_loose, clear_cache_before_run, rerun_if_address_is_in_use, spawn from tests.kit.model_zoo import model_zoo def run_torch_amp(): """ ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_amp/test_naive_fp16.py
tests/test_legacy/test_amp/test_naive_fp16.py
import copy import pytest import torch import colossalai from colossalai.legacy.amp import convert_to_apex_amp, convert_to_naive_amp from colossalai.testing import assert_close_loose, clear_cache_before_run, rerun_if_address_is_in_use, spawn from tests.kit.model_zoo import model_zoo def check_equal(a, b): """ ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_zero/test_commons.py
tests/test_legacy/test_zero/test_commons.py
import torch import colossalai from colossalai.legacy.zero.gemini.tensor_utils import colo_model_data_tensor_move, colo_model_data_tensor_move_inline from colossalai.legacy.zero.sharded_param import ShardedTensor from colossalai.testing import rerun_if_address_is_in_use, spawn def run_tensor_move(rank, world_size, p...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_utils/test_norm_gradient_clipping.py
tests/test_legacy/test_utils/test_norm_gradient_clipping.py
import pytest import torch from torch.nn.parameter import Parameter from torch.nn.utils import clip_grad_norm_ import colossalai from colossalai.accelerator import get_accelerator from colossalai.legacy.tensor import ColoTensorSpec, ProcessGroup, distspec from colossalai.legacy.utils.common import clip_grad_norm from ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_utils/test_memory.py
tests/test_legacy/test_utils/test_memory.py
import pytest import colossalai from colossalai.accelerator import get_accelerator from colossalai.legacy.utils.memory import colo_device_memory_capacity, colo_set_process_memory_fraction from colossalai.testing import spawn def _run_colo_set_process_memory_fraction_and_colo_device_memory_capacity(): frac1 = col...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_utils/test_activation_checkpointing.py
tests/test_legacy/test_utils/test_activation_checkpointing.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import torch import torch.nn.functional as F from colossalai.legacy.context.parallel_mode import ParallelMode from colossalai.legacy.context.random import add_seed, reset_seeds, seed, set_mode from colossalai.legacy.utils.activation_checkpoint import checkpoint from col...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_utils/test_checkpoint/test_checkpoint_2d.py
tests/test_legacy/test_utils/test_checkpoint/test_checkpoint_2d.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import pprint import pytest import torch import torch.nn as nn import colossalai.legacy.nn as col_nn from colossalai.legacy.context.parallel_mode import ParallelMode from colossalai.legacy.core import global_context as gpc from colossalai.legacy.initialize import launc...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_utils/test_checkpoint/test_checkpoint_2p5d.py
tests/test_legacy/test_utils/test_checkpoint/test_checkpoint_2p5d.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import pprint import pytest import torch import torch.nn as nn import colossalai.legacy.nn as col_nn from colossalai.legacy.context.parallel_mode import ParallelMode from colossalai.legacy.core import global_context as gpc from colossalai.legacy.initialize import launc...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_utils/test_checkpoint/test_checkpoint_3d.py
tests/test_legacy/test_utils/test_checkpoint/test_checkpoint_3d.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import pprint import pytest import torch import torch.nn as nn import colossalai.legacy.nn as col_nn from colossalai.legacy.context.parallel_mode import ParallelMode from colossalai.legacy.core import global_context as gpc from colossalai.legacy.initialize import launc...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_legacy/test_utils/test_checkpoint/test_checkpoint_1d.py
tests/test_legacy/test_utils/test_checkpoint/test_checkpoint_1d.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- import pprint import pytest import torch import torch.nn as nn import colossalai.legacy.nn as col_nn from colossalai.legacy.context.parallel_mode import ParallelMode from colossalai.legacy.core import global_context as gpc from colossalai.legacy.initialize import launc...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/__init__.py
tests/test_auto_parallel/__init__.py
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_ckpt_solvers/test_C_solver_consistency.py
tests/test_auto_parallel/test_ckpt_solvers/test_C_solver_consistency.py
import copy import pytest import torch import torch.fx import torchvision.models as tm import colossalai from colossalai.fx import ColoGraphModule, ColoTracer from colossalai.fx._compatibility import is_compatible_with_meta # from colossalai.fx.passes.algorithms import solver_rotor # from colossalai.fx.passes.algori...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_ckpt_solvers/test_ckpt_torchvision.py
tests/test_auto_parallel/test_ckpt_solvers/test_ckpt_torchvision.py
import copy import re from typing import Callable import pytest import torch import torchvision.models as tm from torch.fx import GraphModule import colossalai from colossalai.fx import ColoTracer from colossalai.fx._compatibility import is_compatible_with_meta from colossalai.fx.graph_module import ColoGraphModule ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_ckpt_solvers/test_linearize.py
tests/test_auto_parallel/test_ckpt_solvers/test_linearize.py
import pytest import torch import torchvision.models as tm from colossalai.fx import ColoTracer from colossalai.fx._compatibility import is_compatible_with_meta from colossalai.fx.graph_module import ColoGraphModule # from colossalai.fx.passes.algorithms import linearize, solver_rotor # from colossalai.fx.passes.algo...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_offload/model_utils.py
tests/test_auto_parallel/test_offload/model_utils.py
import torch import torch.nn as nn from transformers import BertConfig, BertLMHeadModel, GPT2Config, GPT2LMHeadModel # from tests.components_to_test.registry import non_distributed_component_funcs class GPTLMModel(nn.Module): def __init__(self, hidden_size=768, num_layers=12, num_attention_heads=12, max_seq_len=...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_offload/test_solver.py
tests/test_auto_parallel/test_offload/test_solver.py
import pytest import torch.fx from torch.fx import GraphModule from torch.utils._pytree import tree_map from colossalai.auto_parallel.offload.region_manager import RegionManager from colossalai.auto_parallel.offload.solver import NOT_NVML, SolverFactory from colossalai.fx import ColoTracer, is_compatible_with_meta fro...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_offload/test_perf.py
tests/test_auto_parallel/test_offload/test_perf.py
import time import pytest import torch from torch.utils._pytree import tree_map import colossalai from colossalai.accelerator import get_accelerator from colossalai.auto_parallel.offload.amp_optimizer import AMPOptimizer from colossalai.auto_parallel.offload.mem_optimize import memory_optimize from colossalai.auto_pa...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_bias_addition_forward.py
tests/test_auto_parallel/test_tensor_shard/test_bias_addition_forward.py
import pytest import torch try: from colossalai.auto_parallel.tensor_shard.initialize import initialize_model NO_CODEGEN = False except: NO_CODEGEN = True from colossalai.device.device_mesh import DeviceMesh from colossalai.initialize import launch from colossalai.logging import disable_existing_loggers ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_broadcast.py
tests/test_auto_parallel/test_tensor_shard/test_broadcast.py
import torch from colossalai.auto_parallel.tensor_shard.utils import ( get_broadcast_shape, is_broadcastable, recover_sharding_spec_for_broadcast_shape, ) from colossalai.device.device_mesh import DeviceMesh from colossalai.tensor.sharding_spec import ShardingSpec def test_is_broadcastable(): x1 = to...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_solver_with_resnet_v2.py
tests/test_auto_parallel/test_tensor_shard/test_solver_with_resnet_v2.py
import torch from torch.fx import GraphModule from torchvision.models import resnet50 from colossalai._analyzer.fx.passes import shape_prop_pass # from colossalai.fx.tracer.tracer import ColoTracer from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.constants import...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/__init__.py
tests/test_auto_parallel/test_tensor_shard/__init__.py
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_compatibility_with_gemini.py
tests/test_auto_parallel/test_tensor_shard/test_compatibility_with_gemini.py
import copy import pytest import torch try: from colossalai.auto_parallel.tensor_shard.initialize import initialize_model NO_CODEGEN = False except: NO_CODEGEN = True from colossalai.accelerator import get_accelerator from colossalai.device.device_mesh import DeviceMesh from colossalai.initialize import...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_liveness_analysis.py
tests/test_auto_parallel/test_tensor_shard/test_liveness_analysis.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.solver import GraphAnalyser from colossala...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_compatibility_with_ddp.py
tests/test_auto_parallel/test_tensor_shard/test_compatibility_with_ddp.py
import copy import pytest import torch from torch.nn.parallel import DistributedDataParallel as DDP try: from colossalai.auto_parallel.tensor_shard.initialize import initialize_model NO_CODEGEN = False except: NO_CODEGEN = True from colossalai.device.device_mesh import DeviceMesh from colossalai.initial...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_find_repeat_block.py
tests/test_auto_parallel/test_tensor_shard/test_find_repeat_block.py
from typing import Optional, Tuple import torch import torch.nn as nn from torch.fx import GraphModule from transformers.pytorch_utils import Conv1D from colossalai._analyzer.fx.passes import shape_prop_pass # from colossalai.fx.tracer.tracer import ColoTracer from colossalai._analyzer.fx.tracer.tracer import ColoTr...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_checkpoint.py
tests/test_auto_parallel/test_tensor_shard/test_checkpoint.py
from typing import Optional, Tuple import pytest import torch import torch.nn as nn from torch.utils.checkpoint import checkpoint from transformers.pytorch_utils import Conv1D try: from colossalai.auto_parallel.tensor_shard.initialize import initialize_model NO_CODEGEN = False except: NO_CODEGEN = True ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_gpt/test_solver_with_gpt_module.py
tests/test_auto_parallel/test_tensor_shard/test_gpt/test_solver_with_gpt_module.py
import torch import transformers from torch.fx import GraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.options import SolverOptions from colossalai.auto_parallel.tensor_shard.solver ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_gpt/test_runtime_with_gpt_modules.py
tests/test_auto_parallel/test_tensor_shard/test_gpt/test_runtime_with_gpt_modules.py
import copy import random from typing import Dict import numpy as np import pytest import torch import transformers from torch.fx import GraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass # from colossalai.fx.tracer.tracer import ColoTracer from colossalai._analyzer.fx.tracer.tracer im...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_gpt/__init__.py
tests/test_auto_parallel/test_tensor_shard/test_gpt/__init__.py
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_gpt/gpt_modules.py
tests/test_auto_parallel/test_tensor_shard/test_gpt/gpt_modules.py
from typing import Optional, Tuple, Union import torch import torch.nn as nn from transformers.activations import ACT2FN from transformers.models.gpt2.modeling_gpt2 import BaseModelOutputWithPastAndCrossAttentions, GPT2PreTrainedModel from transformers.pytorch_utils import Conv1D class GPT2MLP(nn.Module): def __...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_conv_metainfo.py
tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_conv_metainfo.py
import pytest import torch import torch.nn as nn from colossalai.device.device_mesh import DeviceMesh from colossalai.initialize import launch from colossalai.logging import disable_existing_loggers from colossalai.testing.pytest_wrapper import run_on_environment_flag from colossalai.testing.utils import rerun_if_addr...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_binary_elementwise_metainfo.py
tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_binary_elementwise_metainfo.py
import pytest import torch import torch.nn as nn from colossalai.device.device_mesh import DeviceMesh from colossalai.initialize import launch from colossalai.logging import disable_existing_loggers from colossalai.testing.pytest_wrapper import run_on_environment_flag from colossalai.testing.utils import rerun_if_addr...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_linear_metainfo.py
tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_linear_metainfo.py
import pytest import torch import torch.nn as nn from colossalai.device.device_mesh import DeviceMesh from colossalai.initialize import launch from colossalai.logging import disable_existing_loggers from colossalai.testing.pytest_wrapper import run_on_environment_flag from colossalai.testing.utils import rerun_if_addr...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_tensor_metainfo.py
tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_tensor_metainfo.py
import pytest import torch import torch.nn as nn from colossalai.auto_parallel.tensor_shard.sharding_strategy import OperationData, OperationDataType from colossalai.testing.utils import clear_cache_before_run from tests.test_auto_parallel.test_tensor_shard.test_metainfo.utils import print_results if torch.__version_...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_embedding_metainfo.py
tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_embedding_metainfo.py
import pytest import torch from colossalai.auto_parallel.tensor_shard.sharding_strategy import OperationData, OperationDataType from colossalai.testing.utils import clear_cache_before_run from tests.test_auto_parallel.test_tensor_shard.test_metainfo.utils import print_results if torch.__version__ >= "1.12.0": fro...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_metainfo/utils.py
tests/test_auto_parallel/test_tensor_shard/test_metainfo/utils.py
import copy from pprint import pprint from typing import Dict, List import torch from torch.fx import GraphModule from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes import shape_prop_pass # from colossalai.fx.tracer.tracer import ColoTracer from colossalai._analyzer....
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_activation_metainfo.py
tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_activation_metainfo.py
import pytest import torch from colossalai.auto_parallel.meta_profiler import meta_register from colossalai.auto_parallel.tensor_shard.sharding_strategy import OperationData, OperationDataType from colossalai.testing.utils import clear_cache_before_run, parameterize from tests.test_auto_parallel.test_tensor_shard.test...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_where_metainfo.py
tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_where_metainfo.py
import pytest import torch from colossalai.auto_parallel.tensor_shard.sharding_strategy import OperationData, OperationDataType, TrainCycleItem from colossalai.testing.utils import clear_cache_before_run from tests.test_auto_parallel.test_tensor_shard.test_metainfo.utils import print_results if torch.__version__ >= "...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_pooling_metainfo.py
tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_pooling_metainfo.py
import pytest import torch import torch.nn as nn from colossalai.device.device_mesh import DeviceMesh from colossalai.initialize import launch from colossalai.logging import disable_existing_loggers from colossalai.testing.pytest_wrapper import run_on_environment_flag from colossalai.testing.utils import rerun_if_addr...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_norm_metainfo.py
tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_norm_metainfo.py
import pytest import torch import torch.nn as nn from colossalai.auto_parallel.tensor_shard.sharding_strategy import OperationData, OperationDataType, TrainCycleItem from colossalai.device.device_mesh import DeviceMesh from colossalai.initialize import launch from colossalai.logging import disable_existing_loggers fro...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_matmul_metainfo.py
tests/test_auto_parallel/test_tensor_shard/test_metainfo/test_matmul_metainfo.py
import pytest import torch from colossalai.auto_parallel.tensor_shard.sharding_strategy import OperationData, OperationDataType, TrainCycleItem from colossalai.testing.utils import clear_cache_before_run, parameterize from tests.test_auto_parallel.test_tensor_shard.test_metainfo.utils import print_results if torch.__...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_layer_norm_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_layer_norm_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.layer_norm_handler...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_shard_option.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_shard_option.py
import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler import LinearFunctionHandler fro...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_unary_element_wise_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_unary_element_wise_handler.py
import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.conv_handler import ConvFunction...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_bias_linear_module_node.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_bias_linear_module_node.py
import pytest import torch from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler import LinearFunctionHandler from coloss...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_binary_elementwise_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_binary_elementwise_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler import BinaryEleme...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_sum_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_sum_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.linear_handler imp...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_linear_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_linear_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler import LinearFunct...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_matmul_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_matmul_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.matmul_handler imp...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_view_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_view_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler import ViewHandler...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_bmm_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_bmm_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler import BMMFunction...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_placeholder_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_placeholder_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.placeholder_handle...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_bias_linear_function_node.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_bias_linear_function_node.py
import pytest import torch import torch.nn.functional as F from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler import L...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_addbmm_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_addbmm_handler.py
import pytest import torch import torch.nn as nn from colossalai.auto_parallel.tensor_shard.node_handler import BMMFunctionHandler from colossalai.auto_parallel.tensor_shard.sharding_strategy import OperationData, OperationDataType, StrategiesVector from colossalai.device.device_mesh import DeviceMesh from colossalai....
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_addmm_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_addmm_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler import LinearFunct...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_getitem_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_getitem_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.default_reshape_ha...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_split_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_split_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler import SplitHandle...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_where_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_where_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.where_handler impo...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/utils.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/utils.py
import copy from typing import Dict, List import torch from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.passes.runtime_apply_pass import runt...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_norm_pooling_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_norm_pooling_handler.py
import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.normal_pooling_handler import No...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_permute_and_transpose_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_permute_and_transpose_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler import PermuteHand...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_softmax_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_softmax_handler.py
import pytest import torch import torch.nn as nn import torch.nn.functional as F from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_embedding_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_embedding_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.embedding_handler ...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/__init__.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/__init__.py
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_tensor_constructor.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_tensor_constructor.py
import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.tensor_constructor_handler impor...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_conv_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_conv_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.conv_handler impor...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_getattr_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_getattr_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.getattr_handler im...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false
hpcaitech/ColossalAI
https://github.com/hpcaitech/ColossalAI/blob/b1915d2889543949eb5b610241f1515c73df5059/tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_batch_norm_handler.py
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_batch_norm_handler.py
import pytest import torch import torch.nn as nn from colossalai._analyzer.fx.graph_module import ColoGraphModule from colossalai._analyzer.fx.passes.shape_prop import shape_prop_pass from colossalai._analyzer.fx.tracer.tracer import ColoTracer from colossalai.auto_parallel.tensor_shard.node_handler.batch_norm_handler...
python
Apache-2.0
b1915d2889543949eb5b610241f1515c73df5059
2026-01-04T14:40:19.002665Z
false