Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ override-dependencies = [
flash_mla = [
{ git = "https://github.com/deepseek-ai/FlashMLA", rev = "9edee0c022cd0938148a18e334203b0aab43aa19" },
]
transformer-engine = { git = "https://github.com/NVIDIA/TransformerEngine.git", rev = "f031cf87bd054c7558b887df7bed93975456667f" }
transformer-engine = { git = "https://github.com/NVIDIA/TransformerEngine.git", rev = "9e55a255dd2d63bbf6d2c6ec788d0fd27965b42b" }
nemo-run = { git = "https://github.com/NVIDIA-NeMo/Run.git", rev = "17ae86b64d7f75653351664f5d8c9e466faede00" }
emerging_optimizers = { git = "https://github.com/NVIDIA-NeMo/Emerging-Optimizers.git", rev = "v0.2.0" }
nvidia-resiliency-ext = { git = "https://github.com/NVIDIA/nvidia-resiliency-ext.git", rev = "b2bb3d728a18795807d9f76c535e005a609a1b01" }
Expand Down
11 changes: 9 additions & 2 deletions tests/unit_tests/models/test_gpt_model_batch_invariant.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
except ImportError:
HAVE_FA3 = False

try:
from flash_attn.cute.interface import flash_attn_func

HAVE_FA4 = True
except ImportError:
HAVE_FA4 = False


class DummyTokenizer:
def __init__(self, vocab_size: int, bos: int | None = None, eod: int = 0, pad: int = 0):
Expand Down Expand Up @@ -118,8 +125,8 @@ def _train_forward_logprobs(model: torch.nn.Module, tokens: torch.Tensor) -> tor


@pytest.mark.skipif(
not (is_te_min_version("2.10.0") and HAVE_FA3),
reason="TestGPTModelBatchInvariant requires TE >= 2.10.0 and FlashAttention-3",
not (is_te_min_version("2.10.0") and (HAVE_FA3 or HAVE_FA4)),
reason="TestGPTModelBatchInvariant requires TE >= 2.10.0 and FlashAttention-3 or -4",
)
class TestGPTModelBatchInvariant:
"""End-to-end batch-invariance tests for GPT."""
Expand Down
11 changes: 9 additions & 2 deletions tests/unit_tests/transformer/test_te_layers_batch_invariant.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
except ImportError:
HAVE_FA3 = False

try:
from flash_attn.cute.interface import flash_attn_func

HAVE_FA4 = True
except ImportError:
HAVE_FA4 = False


# ============================================================================
# Batch-Invariant test helpers
Expand Down Expand Up @@ -312,8 +319,8 @@ def test_column_parallel_linear_batch_invariant_randomized():


@pytest.mark.skipif(
not (is_te_min_version("2.10.0") and HAVE_FA3),
reason="TE attention BIK tests require TE >= 2.10.0 and FlashAttention-3",
not (is_te_min_version("2.10.0") and (HAVE_FA3 or HAVE_FA4)),
reason="TE attention BIK tests require TE >= 2.10.0 and FlashAttention-3 or -4",
)
def test_te_attention_layer_batch_invariant_randomized():
torch.backends.cuda.matmul.allow_tf32 = False
Expand Down
Loading
Loading