Skip to content

Commit 1ce57fe

Browse files
author
zihugithub
committed
debug0
1 parent 0ef833a commit 1ce57fe

72 files changed

Lines changed: 6792 additions & 1750 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/qa-l0-pytorch-wheel.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

.github/workflows/qa-l0-te-cpp-unittest-pytorch-lint.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ jobs:
8787
source .github/workflows/scripts/gpu_check.sh
8888
wait_for_gpu
8989
90-
# Additional GPU information print
91-
nvidia-smi
92-
python3 -c "import torch; print('CUDA Available:', torch.cuda.is_available()); print('GPU Count:', torch.cuda.device_count())"
93-
9490
- name: Run L0 C++ Unit Tests
9591
# timeout-minutes: 60
9692
env:

.github/workflows/qa-l1-te-cpp-pytorch-tests.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ jobs:
112112
source .github/workflows/scripts/gpu_check.sh
113113
wait_for_gpu
114114
115-
# Additional GPU information print
116-
nvidia-smi
117-
python3 -c "import torch; print('CUDA Available:', torch.cuda.is_available()); print('GPU Count:', torch.cuda.device_count())"
118-
119115
- name: Run L1 PyTorch Thunder Integration Tests
120116
env:
121117
XML_LOG_DIR: "/logs/pytorch/thunder"

.github/workflows/qa-l3-te-pytorch-fa-versions-test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ jobs:
103103
source .github/workflows/scripts/gpu_check.sh
104104
wait_for_gpu
105105
106-
# Additional GPU information print
107-
nvidia-smi
108-
python3 -c "import torch; print('CUDA Available:', torch.cuda.is_available()); print('GPU Count:', torch.cuda.device_count())"
109-
110106
- name: Run QA L3 PyTorch FlashAttention Versions Test
111107
# timeout-minutes: 30
112108
env:

.github/workflows/scripts/gpu_check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ wait_for_gpu() {
6464
echo "Note: If you are using a new chip type, please add GPU idle detection method for your chip"
6565
exit 1
6666
fi
67-
}
67+
}

.github/workflows/te-plugin-tests.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ jobs:
9494
source .github/workflows/scripts/gpu_check.sh
9595
wait_for_gpu
9696
97-
# Additional GPU information print
98-
nvidia-smi
99-
python3 -c "import torch; print('CUDA Available:', torch.cuda.is_available()); print('GPU Count:', torch.cuda.device_count())"
100-
10197
- name: Plugin Test
10298
timeout-minutes: 30
10399
run: |

setup.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,14 @@
4747
def generate_build_config(skip_cuda_build):
4848
"""Generate build-time configuration file."""
4949
config_template_path = (
50-
current_file_path / "transformer_engine" / "plugin" /
51-
"core" / "_build_config.py.template"
50+
current_file_path / "transformer_engine" / "plugin" / "core" / "_build_config.py.template"
5251
)
5352
config_output_path = (
54-
current_file_path / "transformer_engine" / "plugin" /
55-
"core" / "_build_config.py"
53+
current_file_path / "transformer_engine" / "plugin" / "core" / "_build_config.py"
5654
)
5755

5856
if config_template_path.exists():
59-
with open(config_template_path, 'r') as f:
57+
with open(config_template_path, "r") as f:
6058
template = f.read()
6159

6260
config_content = template.format(
@@ -65,7 +63,7 @@ def generate_build_config(skip_cuda_build):
6563
platform=platform.platform(),
6664
)
6765

68-
with open(config_output_path, 'w') as f:
66+
with open(config_output_path, "w") as f:
6967
f.write(config_content)
7068

7169
print(f"Generated build config: {config_output_path}")
@@ -77,7 +75,7 @@ def generate_build_config(skip_cuda_build):
7775
BUILD_TIME = "{datetime.now().isoformat()}"
7876
BUILD_PLATFORM = "{platform.platform()}"
7977
"""
80-
with open(config_output_path, 'w') as f:
78+
with open(config_output_path, "w") as f:
8179
f.write(config_content)
8280
print(f"Generated minimal build config: {config_output_path}")
8381

@@ -86,7 +84,7 @@ class CustomInstall(InstallCommand):
8684
"""Custom install command to generate build config."""
8785

8886
user_options = InstallCommand.user_options + [
89-
('skip-cuda-build', None, 'Skip CUDA build'),
87+
("skip-cuda-build", None, "Skip CUDA build"),
9088
]
9189

9290
def initialize_options(self):

transformer_engine/common/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,21 @@ def skip_cuda_build() -> bool:
3131
# Fall back to build-time configuration
3232
try:
3333
from transformer_engine.plugin.core._build_config import SKIP_CUDA_BUILD
34+
3435
return SKIP_CUDA_BUILD
3536
except ImportError:
3637
# If build config doesn't exist, default to False
3738
return False
3839

40+
3941
# Load plugin system - this handles module registration and backend initialization
4042
# The _module_setup inside core will:
4143
# 1. Register modules under both full and short names for relative imports
4244
# 2. Load all available backends (flagos, reference, vendor/cuda, etc.)
4345
# 3. Register transformer_engine_torch module from the selected backend
4446
import transformer_engine.plugin.core # noqa: F401
4547

48+
4649
@functools.lru_cache(maxsize=None)
4750
def _is_package_installed(package) -> bool:
4851
"""Check if the given package is installed via pip."""

transformer_engine/plugin/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
get_registry,
1010
)
1111

12+
1213
def __getattr__(name):
1314
if name == "tefl":
1415
return _get_tefl_module()
1516
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
1617

18+
1719
__all__ = [
1820
"TEFLBackendBase",
1921
"TEFLModule",

0 commit comments

Comments
 (0)