Skip to content
Merged
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
1 change: 0 additions & 1 deletion tests/integration/test_lists/waives.txt
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ unittest/_torch/modeling/test_modeling_qwen_moe.py::TestQwenMoe::test_qwen_moe_a
unittest/_torch/modules/moe/test_moe_backend.py::test_moe_backend -k "TRTLLM" SKIP (https://nvbugs/6602176)
unittest/_torch/modules/moe/test_moe_backend.py::test_moe_backend[act=Relu2-e60_k4_h2048_i1408-seq=8-dtype=torch.bfloat16-backend=TRTLLM-quant=NVFP4-routing=Renormalize] SKIP (https://nvbugs/5989912)
unittest/_torch/modules/moe/test_moe_module.py::test_configurable_moe_multi_gpu -k "MEGAMOE_CUTEDSL" SKIP (https://nvbugs/6601578)
unittest/_torch/modules/moe/test_moe_module.py::test_configurable_moe_single_gpu -k "MEGAMOE_CUTEDSL" SKIP (https://nvbugs/6572835)
unittest/_torch/modules/moe/test_moe_module.py::test_configurable_moe_single_gpu -k "TRTLLM" SKIP (https://nvbugs/6464169)
unittest/_torch/modules/test_w4a16_nvfp4_linear.py::test_nvfp4_attention_keeps_high_precision_output_for_hopper_marlin SKIP (https://nvbugs/6581071)
unittest/_torch/modules/tests_lora_modules/test_nemotron_h_lora_sanity.py::TestNemotronHLoRA::test_lora_pp2_sanity SKIP (https://nvbugs/6428124)
Expand Down
8 changes: 8 additions & 0 deletions tests/microbenchmarks/bench_moe/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ def _ensure_dist_for_megamoe(moe_backend: str, rank: int, world_size: int) -> No
raise RuntimeError("CUDA required for MegaMoE backend")
if dist.is_initialized():
return
if world_size == 1:
dist.init_process_group(
backend="nccl",
store=dist.HashStore(),
rank=rank,
world_size=world_size,
)
return
rendezvous = None
if rank == 0:
master_addr = os.environ.get("MASTER_ADDR") or "127.0.0.1"
Expand Down
13 changes: 6 additions & 7 deletions tests/unittest/_torch/modules/moe/test_moe_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import importlib
import itertools
import logging
import os
from types import SimpleNamespace
from typing import List, Optional, Tuple
from unittest.mock import MagicMock
Expand Down Expand Up @@ -138,13 +137,13 @@ def _ensure_single_proc_dist_for_megamoe(backend_type: MoeBackendType, rank: int
pytest.skip("CUDA required for MegaMoE tests")
Comment thread
Barry-Delaney marked this conversation as resolved.
if dist.is_initialized():
return
os.environ.setdefault("MASTER_ADDR", "127.0.0.1")
os.environ.setdefault("MASTER_PORT", "29561")
os.environ.setdefault("RANK", "0")
os.environ.setdefault("WORLD_SIZE", "1")
os.environ.setdefault("LOCAL_RANK", str(rank))
torch.cuda.set_device(rank)
dist.init_process_group(backend="nccl", rank=0, world_size=1)
dist.init_process_group(
backend="nccl",
store=dist.HashStore(),
rank=0,
world_size=1,
)


def should_skip_gptoss(
Expand Down
9 changes: 9 additions & 0 deletions tests/unittest/_torch/modules/moe/test_moe_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ def _ensure_dist_for_megamoe(moe_backend: str, rank: int, world_size: int) -> No
pytest.skip("CUDA required for MegaMoE tests")
if dist.is_initialized():
return
if world_size == 1:
torch.cuda.set_device(rank)
dist.init_process_group(
backend="nccl",
store=dist.HashStore(),
rank=rank,
world_size=world_size,
)
return
os.environ.setdefault("MASTER_ADDR", "127.0.0.1")
os.environ.setdefault("MASTER_PORT", "29561")
Comment thread
Barry-Delaney marked this conversation as resolved.
os.environ["RANK"] = str(rank)
Expand Down
Loading