- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 10.9k
Open
Labels
Description
Your current environment
The output of python collect_env.py
Collecting environment information...
uv is set
==============================
        System Info
==============================
OS                           : Ubuntu 22.04.4 LTS (x86_64)
GCC version                  : (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version                : Could not collect
CMake version                : version 4.1.0
Libc version                 : glibc-2.35
==============================
       PyTorch Info
==============================
PyTorch version              : 2.9.0+cu128
Is debug build               : False
CUDA used to build PyTorch   : 12.8
ROCM used to build PyTorch   : N/A
==============================
      Python Environment
==============================
Python version               : 3.10.12 (main, Jan 17 2025, 14:35:34) [GCC 11.4.0] (64-bit runtime)
Python platform              : Linux-5.15.0-113-generic-x86_64-with-glibc2.35
==============================
       CUDA / GPU Info
==============================
Is CUDA available            : True
CUDA runtime version         : 12.8.61
CUDA_MODULE_LOADING set to   : 
GPU models and configuration : 
GPU 0: NVIDIA H100 80GB HBM3
GPU 1: NVIDIA H100 80GB HBM3
GPU 2: NVIDIA H100 80GB HBM3
GPU 3: NVIDIA H100 80GB HBM3
GPU 4: NVIDIA H100 80GB HBM3
GPU 5: NVIDIA H100 80GB HBM3
GPU 6: NVIDIA H100 80GB HBM3
GPU 7: NVIDIA H100 80GB HBM3
Nvidia driver version        : 570.86.10
cuDNN version                : Could not collect
HIP runtime version          : N/A
MIOpen runtime version       : N/A
Is XNNPACK available         : True
==============================
          CPU Info
==============================
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      52 bits physical, 57 bits virtual
Byte Order:                         Little Endian
CPU(s):                             384
On-line CPU(s) list:                0-383
Vendor ID:                          AuthenticAMD
Model name:                         AMD EPYC 9654 96-Core Processor
CPU family:                         25
Model:                              17
Thread(s) per core:                 2
Core(s) per socket:                 96
Socket(s):                          2
Stepping:                           1
Frequency boost:                    enabled
CPU max MHz:                        3707.8120
CPU min MHz:                        1500.0000
BogoMIPS:                           4799.98
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 invpcid_single hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq la57 rdpid overflow_recov succor smca fsrm flush_l1d
Virtualization:                     AMD-V
L1d cache:                          6 MiB (192 instances)
L1i cache:                          6 MiB (192 instances)
L2 cache:                           192 MiB (192 instances)
L3 cache:                           768 MiB (24 instances)
NUMA node(s):                       2
NUMA node0 CPU(s):                  0-95,192-287
NUMA node1 CPU(s):                  96-191,288-383
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Not affected
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Mitigation; safe RET
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines; IBPB conditional; IBRS_FW; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected
==============================
Versions of relevant libraries
==============================
[pip3] efficientnet-pytorch==0.7.1
[pip3] flashinfer-python==0.4.1
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.8.4.1
[pip3] nvidia-cuda-cupti-cu12==12.8.90
[pip3] nvidia-cuda-nvrtc-cu12==12.8.93
[pip3] nvidia-cuda-runtime-cu12==12.8.90
[pip3] nvidia-cudnn-cu12==9.10.2.21
[pip3] nvidia-cudnn-frontend==1.15.0
[pip3] nvidia-cufft-cu12==11.3.3.83
[pip3] nvidia-cufile-cu12==1.13.1.3
[pip3] nvidia-curand-cu12==10.3.9.90
[pip3] nvidia-cusolver-cu12==11.7.3.90
[pip3] nvidia-cusparse-cu12==12.5.8.93
[pip3] nvidia-cusparselt-cu12==0.7.1
[pip3] nvidia-cutlass-dsl==4.2.1
[pip3] nvidia-ml-py==13.580.82
[pip3] nvidia-nccl-cu12==2.27.5
[pip3] nvidia-nvjitlink-cu12==12.8.93
[pip3] nvidia-nvshmem-cu12==3.3.20
[pip3] nvidia-nvtx-cu12==12.8.90
[pip3] open-clip-torch==2.32.0
[pip3] pytorch-lightning==2.5.2
[pip3] pyzmq==27.1.0
[pip3] segmentation-models-pytorch==0.4.0
[pip3] sentence-transformers==3.2.1
[pip3] terratorch==1.0.2
[pip3] torch==2.9.0+cu128
[pip3] torchaudio==2.9.0+cu128
[pip3] torchgeo==0.6.2
[pip3] torchmetrics==1.7.4
[pip3] torchvision==0.24.0+cu128
[pip3] transformers==4.56.2
[pip3] transformers-stream-generator==0.0.5
[pip3] triton==3.5.0
[pip3] tritonclient==2.51.0
[pip3] vector-quantize-pytorch==1.21.2
[conda] Could not collect
==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.11.0rc2.dev353+g11064728b.d20251012 (git sha: 11064728b, date: 20251012)
vLLM Build Flags:
  CUDA Archs: Not Set; ROCm: Disabled
GPU Topology:
        GPU0    GPU1    GPU2    GPU3    GPU4    GPU5    GPU6    GPU7    NIC0    NIC1    NIC2    NIC3    NIC4    NIC5    NIC6    NIC7    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      NV18    NV18    NV18    NV18    NV18    NV18    NV18    NODE    NODE    PIX     NODE    SYS     SYS     SYS     SYS     0-95,192-287    0               N/A
GPU1    NV18     X      NV18    NV18    NV18    NV18    NV18    NV18    NODE    NODE    NODE    PIX     SYS     SYS     SYS     SYS     0-95,192-287    0               N/A
GPU2    NV18    NV18     X      NV18    NV18    NV18    NV18    NV18    NODE    PIX     NODE    NODE    SYS     SYS     SYS     SYS     0-95,192-287    0               N/A
GPU3    NV18    NV18    NV18     X      NV18    NV18    NV18    NV18    PIX     NODE    NODE    NODE    SYS     SYS     SYS     SYS     0-95,192-287    0               N/A
GPU4    NV18    NV18    NV18    NV18     X      NV18    NV18    NV18    SYS     SYS     SYS     SYS     NODE    NODE    PIX     NODE    96-191,288-383  1               N/A
GPU5    NV18    NV18    NV18    NV18    NV18     X      NV18    NV18    SYS     SYS     SYS     SYS     NODE    NODE    NODE    PIX     96-191,288-383  1               N/A
GPU6    NV18    NV18    NV18    NV18    NV18    NV18     X      NV18    SYS     SYS     SYS     SYS     NODE    PIX     NODE    NODE    96-191,288-383  1               N/A
GPU7    NV18    NV18    NV18    NV18    NV18    NV18    NV18     X      SYS     SYS     SYS     SYS     PIX     NODE    NODE    NODE    96-191,288-383  1               N/A
NIC0    NODE    NODE    NODE    PIX     SYS     SYS     SYS     SYS      X      NODE    NODE    NODE    SYS     SYS     SYS     SYS                             
NIC1    NODE    NODE    PIX     NODE    SYS     SYS     SYS     SYS     NODE     X      NODE    NODE    SYS     SYS     SYS     SYS                             
NIC2    PIX     NODE    NODE    NODE    SYS     SYS     SYS     SYS     NODE    NODE     X      NODE    SYS     SYS     SYS     SYS                             
NIC3    NODE    PIX     NODE    NODE    SYS     SYS     SYS     SYS     NODE    NODE    NODE     X      SYS     SYS     SYS     SYS                             
NIC4    SYS     SYS     SYS     SYS     NODE    NODE    NODE    PIX     SYS     SYS     SYS     SYS      X      NODE    NODE    NODE                            
NIC5    SYS     SYS     SYS     SYS     NODE    NODE    PIX     NODE    SYS     SYS     SYS     SYS     NODE     X      NODE    NODE                            
NIC6    SYS     SYS     SYS     SYS     PIX     NODE    NODE    NODE    SYS     SYS     SYS     SYS     NODE    NODE     X      NODE                            
NIC7    SYS     SYS     SYS     SYS     NODE    PIX     NODE    NODE    SYS     SYS     SYS     SYS     NODE    NODE    NODE     X                              
Legend:
  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks
NIC Legend:
  NIC0: mlx5_0
  NIC1: mlx5_1
  NIC2: mlx5_2
  NIC3: mlx5_3
  NIC4: mlx5_4
  NIC5: mlx5_5
  NIC6: mlx5_6
  NIC7: mlx5_7
==============================
     Environment Variables
==============================
LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64
CUDA_HOME=/usr/local/cuda
CUDA_HOME=/usr/local/cuda
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1
🐛 Describe the bug
When using sequence parallelism, we transform a sequence of all_reduce -> rms_norm -> quant into reduce_scatter -> rms_norm -> quant_fp8 -> all_gather. Async TP then fuses the 2 communication ops onto the GEMMs surrounding this pattern. Whether we're using SP or not, we expect the sequence of rms_norm -> quant_fp8 to produce a single fused Triton kernel. That is the case without SP + Async TP but with those two passes, Inductor generates two separate kernels for some reason.
This requires #27126. Repro command:
python examples/offline_inference/basic/generate.py --model redhatai/meta-llama-3.1-70B-Instruct-FP8 --tensor-parallel-size=4 --kv-cache-dtype=fp8 --no-enable-prefix-caching --gpu_memory_utilization=0.8 -O.pass_config='{"enable_async_tp":true,"enable_noop":true}' -O.use_inductor_graph_partition=True -O.cudagraph_mode=NONE --load-format=dummy
Inductor output code without SP + Async TP:
def partition_1(...):
    ...
    # Topologically Sorted Source Nodes: [view_7, unified_attention_with_output, to_10, reciprocal_2, mul_15, clamp_2, to_11, cutlass_scaled_mm_1], Original ATen: [aten.view, aten._to_copy, aten.reciprocal, aten.mul, aten.clamp, _C.cutlass_scaled_mm]
    triton_poi_fused__to_copy_clamp_cutlass_scaled_mm_mul_reciprocal_view_3_xnumel = 2048*s72
    stream0 = get_raw_stream(0)
    triton_poi_fused__to_copy_clamp_cutlass_scaled_mm_mul_reciprocal_view_3.run(buf10, arg10_1, buf15, triton_poi_fused__to_copy_clamp_cutlass_scaled_mm_mul_reciprocal_view_3_xnumel, stream=stream0)
    # Topologically Sorted Source Nodes: [view_7, unified_attention_with_output, to_10, reciprocal_2, mul_15, clamp_2, to_11, cutlass_scaled_mm_1], Original ATen: [aten.view, aten._to_copy, aten.reciprocal, aten.mul, aten.clamp, _C.cutlass_scaled_mm]
    torch.ops._C.cutlass_scaled_mm.default(buf14, buf15, arg11_1, arg10_1, arg12_1, None)
    del arg10_1
    del arg11_1
    del arg12_1
    buf18 = empty_strided_cuda((s72, 14336), (14336, 1), torch.bfloat16)
    # Topologically Sorted Source Nodes: [all_reduce_1], Original ATen: [vllm.all_reduce]
    buf19 = torch.ops.vllm.all_reduce.default(buf14, 'tp:0')
    buf20 = buf19
    assert_size_stride(buf20, (s72, 8192), (8192, 1), 'torch.ops.vllm.all_reduce.default')
    assert_alignment(buf20, 16, 'torch.ops.vllm.all_reduce.default')
    del buf19
    buf22 = empty_strided_cuda((s72, 8192), (8192, 1), torch.float8_e4m3fn)
    # Topologically Sorted Source Nodes: [to_12, add_4, pow_2, mean_1, add_5, rsqrt_1, mul_16, to_14, mul_17, to_15, reciprocal_3, mul_18, clamp_3, to_16, cutlass_scaled_mm_2], Original ATen: [aten._to_copy, aten.add, aten.pow, aten.mean, aten.rsqrt, aten.mul, aten.reciprocal, aten.clamp, _C.cutlass_scaled_mm]
    stream0 = get_raw_stream(0)
    triton_red_fused__to_copy_add_clamp_cutlass_scaled_mm_mean_mul_pow_reciprocal_rsqrt_4.run(buf20, buf3, arg13_1, arg14_1, buf22, s72, 8192, stream=stream0)
    del arg13_1
    # Topologically Sorted Source Nodes: [to_12, add_4, pow_2, mean_1, add_5, rsqrt_1, mul_16, to_14, mul_17, to_15, reciprocal_3, mul_18, clamp_3, to_16, cutlass_scaled_mm_2], Original ATen: [aten._to_copy, aten.add, aten.pow, aten.mean, aten.rsqrt, aten.mul, aten.reciprocal, aten.clamp, _C.cutlass_scaled_mm]
    torch.ops._C.cutlass_scaled_mm.default(buf18, buf22, arg15_1, arg14_1, arg16_1, None)
Inductor output code with SP + Async TP:
def partition_1(...):
    ...
# Topologically Sorted Source Nodes: [view_7, unified_attention_with_output, to_10, reciprocal_2, mul_15, clamp_2, to_11], Original ATen: [aten.view, aten._to_copy, aten.reciprocal, aten.mul, aten.clamp, vllm.patched_fused_scaled_matmul_reduce_scatter]
    triton_poi_fused__to_copy_clamp_mul_patched_fused_scaled_matmul_reduce_scatter_reciprocal_view_5_xnumel = 2048*s72
    stream0 = get_raw_stream(0)
    triton_poi_fused__to_copy_clamp_mul_patched_fused_scaled_matmul_reduce_scatter_reciprocal_view_5.run(buf10, arg10_1, buf14, triton_poi_fused__to_copy_clamp_mul_patched_fused_scaled_matmul_reduce_scatter_reciprocal_view_5_xnumel, stream=stream0)
    # Topologically Sorted Source Nodes: [view_7, unified_attention_with_output, to_10, reciprocal_2, mul_15, clamp_2, to_11], Original ATen: [aten.view, aten._to_copy, aten.reciprocal, aten.mul, aten.clamp, vllm.patched_fused_scaled_matmul_reduce_scatter]
    buf15 = torch.ops.vllm.patched_fused_scaled_matmul_reduce_scatter.default(buf14, arg11_1, arg10_1, arg12_1, 'avg', 0, 0, '3', [s72, 8192], None, None, torch.bfloat16, use_fast_accum=False)
    del arg10_1
    del arg11_1
    del arg12_1
    buf16 = buf15
    assert_size_stride(buf16, (s72 // 4, 8192), (8192, 1), 'torch.ops.vllm.patched_fused_scaled_matmul_reduce_scatter.default')
    assert_alignment(buf16, 16, 'torch.ops.vllm.patched_fused_scaled_matmul_reduce_scatter.default')
    del buf15
    buf17 = empty_strided_cuda((s72 // 4, 1), (1, s72 // 4), torch.float32)
    # Topologically Sorted Source Nodes: [], Original ATen: [aten._to_copy, aten.add, aten.pow, aten.mean]
    triton_red_fused__to_copy_add_mean_pow_6_xnumel = s72 // 4
    stream0 = get_raw_stream(0)
    triton_red_fused__to_copy_add_mean_pow_6.run(buf16, buf2, buf17, triton_red_fused__to_copy_add_mean_pow_6_xnumel, 8192, stream=stream0)
    buf18 = empty_strided_cuda((s72 // 4, 8192), (8192, 1), torch.float8_e4m3fn)
    # Topologically Sorted Source Nodes: [], Original ATen: [aten._to_copy, aten.add, aten.pow, aten.mean, aten.rsqrt, aten.mul, aten.reciprocal, aten.clamp, symm_mem.fused_all_gather_scaled_matmul]
    triton_poi_fused__to_copy_add_clamp_fused_all_gather_scaled_matmul_mean_mul_pow_reciprocal_rsqrt_7_xnumel = 8192*(s72 // 4)
    stream0 = get_raw_stream(0)
    triton_poi_fused__to_copy_add_clamp_fused_all_gather_scaled_matmul_mean_mul_pow_reciprocal_rsqrt_7.run(buf16, buf2, buf17, arg13_1, arg14_1, buf18, triton_poi_fused__to_copy_add_clamp_fused_all_gather_scaled_matmul_mean_mul_pow_reciprocal_rsqrt_7_xnumel, stream=stream0)
    del arg13_1
    # Topologically Sorted Source Nodes: [], Original ATen: [aten._to_copy, aten.add, aten.pow, aten.mean, aten.rsqrt, aten.mul, aten.reciprocal, aten.clamp, symm_mem.fused_all_gather_scaled_matmul]
    buf19 = torch.ops.symm_mem.fused_all_gather_scaled_matmul.default(buf18, [arg15_1], arg14_1, [arg16_1], 0, '3', [None], [None], [15], [False])
Before submitting a new issue...
- Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Ready