Skip to content

Commit c83d1e4

Browse files
committed
IFU release v1.12
2 parents 6e9405b + 7f2afaa commit c83d1e4

29 files changed

Lines changed: 390 additions & 233 deletions

File tree

3rdparty/cudnn-frontend

Submodule cudnn-frontend updated 146 files

build_tools/VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.12.0.dev0
1+
1.12.0

ci/pytorch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ run_test_config_mgpu(){
7171
if [ $_fus_attn = "auto" -a $_gemm = "hipblaslt" ]; then
7272
echo ==== Run mGPU with GEMM backend: $_gemm and Fused attention backend: $_fus_attn ====
7373
run 3 test_fused_optimizer.py
74-
run 3 test_fusible_ops_distributed.py
75-
run 3 fused_attn/test_fused_attn_with_cp.py
74+
run 3 distributed/test_fusible_ops.py
7675
run 3 distributed/test_numerics.py
76+
run 3 fused_attn/test_fused_attn_with_cp.py
7777
fi
7878
}
7979

examples/jax/encoder/common.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file was modified for portability to AMDGPU
2+
# Copyright (c) 2025, Advanced Micro Devices, Inc. All rights reserved.
3+
# Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4+
#
5+
# See LICENSE for license information.
6+
"""Shared functions for the encoder tests"""
7+
from functools import lru_cache
8+
9+
from transformer_engine.jax import is_hip_extension
10+
from transformer_engine.transformer_engine_jax import get_device_compute_capability
11+
12+
13+
@lru_cache
14+
def is_bf16_supported():
15+
"""Return if BF16 has hardware supported"""
16+
gpu_arch = is_hip_extension() or get_device_compute_capability(0)
17+
return gpu_arch >= 80

examples/jax/encoder/test_model_parallel_encoder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import transformer_engine.jax as te
2525
import transformer_engine.jax.flax as te_flax
2626

27+
from common import is_bf16_supported
28+
2729
DEVICE_DP_AXIS = "data"
2830
DEVICE_TP_AXIS = "model"
2931
NAMED_BROADCAST_AXIS = "my_broadcast_axis"
@@ -436,6 +438,7 @@ def setUpClass(cls):
436438
"""Run 3 epochs for testing"""
437439
cls.args = encoder_parser(["--epochs", "3"])
438440

441+
@unittest.skipIf(not is_bf16_supported(), "Device compute capability 8.0+ is required for BF16")
439442
def test_te_bf16(self):
440443
"""Test Transformer Engine with BF16"""
441444
actual = train_and_evaluate(self.args)
@@ -448,6 +451,7 @@ def test_te_fp8(self):
448451
actual = train_and_evaluate(self.args)
449452
assert actual[0] < 0.45 and actual[1] > 0.79
450453

454+
@unittest.skipIf(not is_bf16_supported(), "Device compute capability 8.0+ is required for BF16")
451455
def test_te_bf16_sp(self):
452456
"""Test Transformer Engine with BF16 + SP"""
453457
self.args.enable_sp = True

examples/jax/encoder/test_multigpu_encoder.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import transformer_engine.jax as te
2525
import transformer_engine.jax.flax as te_flax
2626

27+
from common import is_bf16_supported
28+
2729
DEVICE_DP_AXIS = "data"
2830
PARAMS_KEY = "params"
2931
PARAMS_AXES_KEY = PARAMS_KEY + "_axes"
@@ -404,6 +406,7 @@ def setUpClass(cls):
404406
"""Run 3 epochs for testing"""
405407
cls.args = encoder_parser(["--epochs", "3"])
406408

409+
@unittest.skipIf(not is_bf16_supported(), "Device compute capability 8.0+ is required for BF16")
407410
def test_te_bf16(self):
408411
"""Test Transformer Engine with BF16"""
409412
actual = train_and_evaluate(self.args)

examples/jax/encoder/test_multiprocessing_encoder.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import transformer_engine.jax as te
2727
import transformer_engine.jax.flax as te_flax
2828

29+
from common import is_bf16_supported
30+
2931
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
3032
DEVICE_DP_AXIS = "data"
3133
DEVICE_TP_AXIS = "model"
@@ -554,8 +556,9 @@ def encoder_parser(args):
554556
def query_gpu(q):
555557
"""Query GPU info on the system"""
556558
gpu_has_fp8, reason = te.fp8.is_fp8_available()
559+
gpu_has_bf16 = is_bf16_supported()
557560
num_gpu = len(jax.devices())
558-
q.put([num_gpu, gpu_has_fp8, reason])
561+
q.put([num_gpu, gpu_has_fp8, gpu_has_bf16, reason])
559562

560563

561564
def unittest_query_gpu():
@@ -568,15 +571,15 @@ def unittest_query_gpu():
568571
q = mp.Queue()
569572
p = mp.Process(target=query_gpu, args=(q,))
570573
p.start()
571-
num_gpu, gpu_has_fp8, reason = q.get()
574+
num_gpu, gpu_has_fp8, gpu_has_bf16, reason = q.get()
572575
p.join()
573-
return num_gpu, gpu_has_fp8, reason
576+
return num_gpu, gpu_has_fp8, gpu_has_bf16, reason
574577

575578

576579
class TestEncoder(unittest.TestCase):
577580
"""Encoder unittests"""
578581

579-
num_gpu, gpu_has_fp8, reason = unittest_query_gpu()
582+
num_gpu, gpu_has_fp8, gpu_has_bf16, reason = unittest_query_gpu()
580583

581584
def exec(self, use_fp8):
582585
"""Run 3 epochs for testing"""
@@ -600,6 +603,7 @@ def exec(self, use_fp8):
600603

601604
return results
602605

606+
@unittest.skipIf(not gpu_has_bf16, "Device compute capability 8.0+ is required for BF16")
603607
def test_te_bf16(self):
604608
"""Test Transformer Engine with BF16"""
605609
results = self.exec(False)

examples/jax/encoder/test_single_gpu_encoder.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import transformer_engine.jax as te
2222
import transformer_engine.jax.flax as te_flax
2323

24+
from common import is_bf16_supported
25+
2426
PARAMS_KEY = "params"
2527
DROPOUT_KEY = "dropout"
2628
INPUT_KEY = "input_rng"
@@ -323,6 +325,7 @@ def setUpClass(cls):
323325
"""Run 4 epochs for testing"""
324326
cls.args = encoder_parser(["--epochs", "3"])
325327

328+
@unittest.skipIf(not is_bf16_supported(), "Device compute capability 8.0+ is required for BF16")
326329
def test_te_bf16(self):
327330
"""Test Transformer Engine with BF16"""
328331
actual = train_and_evaluate(self.args)

qa/L0_jax_unittest/test.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@ pip install -r $TE_PATH/examples/jax/encoder/requirements.txt
1818

1919
pytest -c $TE_PATH/tests/jax/pytest.ini -v $TE_PATH/examples/jax/mnist
2020

21-
# Make encoder tests to have run-to-run deterministic to have the stable CI results
22-
export XLA_FLAGS="${XLA_FLAGS} --xla_gpu_deterministic_ops"
2321
pytest -c $TE_PATH/tests/jax/pytest.ini -v $TE_PATH/examples/jax/encoder --ignore=$TE_PATH/examples/jax/encoder/test_multiprocessing_encoder.py
2422
pytest -c $TE_PATH/tests/jax/pytest.ini -v $TE_PATH/examples/jax/encoder/test_multiprocessing_encoder.py

qa/L0_paddle_wheel/test.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ set -e
66

77
: "${TE_PATH:=/opt/transformerengine}"
88

9-
pip install wheel==0.44.0 pydantic
9+
# Install dependencies
10+
# Note: Need to install wheel locally since PaddlePaddle container
11+
# already contains APT install.
12+
pip install pydantic
13+
pip install --user wheel==0.44.0
1014

1115
cd $TE_PATH
1216
pip uninstall -y transformer-engine transformer-engine-cu12 transformer-engine-paddle
@@ -16,11 +20,11 @@ WHL_BASE="transformer_engine-${VERSION}"
1620

1721
# Core wheel.
1822
NVTE_RELEASE_BUILD=1 python setup.py bdist_wheel
19-
wheel unpack dist/*
23+
python -m wheel unpack dist/*
2024
sed -i "s/Name: transformer-engine/Name: transformer-engine-cu12/g" "transformer_engine-${VERSION}/transformer_engine-${VERSION}.dist-info/METADATA"
2125
sed -i "s/Name: transformer_engine/Name: transformer_engine_cu12/g" "transformer_engine-${VERSION}/transformer_engine-${VERSION}.dist-info/METADATA"
2226
mv "${WHL_BASE}/${WHL_BASE}.dist-info" "${WHL_BASE}/transformer_engine_cu12-${VERSION}.dist-info"
23-
wheel pack ${WHL_BASE}
27+
python -m wheel pack ${WHL_BASE}
2428
rm dist/*.whl
2529
mv *.whl dist/
2630
NVTE_RELEASE_BUILD=1 NVTE_BUILD_METAPACKAGE=1 python setup.py bdist_wheel

0 commit comments

Comments
 (0)