bytedance / flux

A fast communication-overlapping library for tensor parallelism on GPUs.
Apache License 2.0
223 stars 17 forks source link

[BUG] RuntimeError: Could not retrieve or create the backend 2 for device type cuda #11

Closed tlrmchlsmth closed 4 months ago

tlrmchlsmth commented 4 months ago

Describe the bug I'm trying to use the latest update, but running into a new issue.

Running:

torchrun --node_rank=0 --nproc_per_node=8 --nnodes=1 --rdzv_endpoint=127.0.0.1:23456 ./test/test_gemm_rs.py 1024 1024 1024

Results in the following:

torchrun --node_rank=0 --nproc_per_node=8 --nnodes=1 --rdzv_endpoint=127.0.0.1:23456 ./test/test_gemm_rs.py 1024 1024 1024
W0628 20:24:58.330000 140061210293376 torch/distributed/run.py:757]
W0628 20:24:58.330000 140061210293376 torch/distributed/run.py:757] *****************************************
W0628 20:24:58.330000 140061210293376 torch/distributed/run.py:757] Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
W0628 20:24:58.330000 140061210293376 torch/distributed/run.py:757] *****************************************
before flux shm initialization
after flux shm initialization
before flux shm initialization
before flux shm initialization
after flux shm initialization
after flux shm initialization
before flux shm initialization
after flux shm initialization
before flux shm initialization
after flux shm initialization
before flux shm initialization
after flux shm initialization
before flux shm initialization
after flux shm initialization
before flux shm initialization
after flux shm initialization
[rank6]: Traceback (most recent call last):
[rank6]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 367, in <module>
[rank6]:     perf_res_flux = perf_flux(
[rank6]:   File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
[rank6]:     return func(*args, **kwargs)
[rank6]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 204, in perf_flux
[rank6]:     gemm_rs_op = cls(
[rank6]: RuntimeError: Could not retrieve or create the backend 2 for device type cuda
[rank4]: Traceback (most recent call last):
[rank4]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 367, in <module>
[rank4]:     perf_res_flux = perf_flux(
[rank4]:   File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
[rank4]:     return func(*args, **kwargs)
[rank4]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 204, in perf_flux
[rank4]:     gemm_rs_op = cls(
[rank4]: RuntimeError: Could not retrieve or create the backend 2 for device type cuda
[rank7]: Traceback (most recent call last):
[rank7]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 367, in <module>
[rank7]:     perf_res_flux = perf_flux(
[rank7]:   File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
[rank7]:     return func(*args, **kwargs)
[rank7]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 204, in perf_flux
[rank7]:     gemm_rs_op = cls(
[rank7]: RuntimeError: Could not retrieve or create the backend 2 for device type cuda
[rank0]: Traceback (most recent call last):
[rank0]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 367, in <module>
[rank0]:     perf_res_flux = perf_flux(
[rank0]:   File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
[rank0]:     return func(*args, **kwargs)
[rank0]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 204, in perf_flux
[rank0]:     gemm_rs_op = cls(
[rank0]: RuntimeError: Could not retrieve or create the backend 2 for device type cuda
[rank3]: Traceback (most recent call last):
[rank3]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 367, in <module>
[rank3]:     perf_res_flux = perf_flux(
[rank3]:   File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
[rank3]:     return func(*args, **kwargs)
[rank3]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 204, in perf_flux
[rank3]:     gemm_rs_op = cls(
[rank3]: RuntimeError: Could not retrieve or create the backend 2 for device type cuda
[rank1]: Traceback (most recent call last):
[rank1]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 367, in <module>
[rank1]:     perf_res_flux = perf_flux(
[rank1]:   File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
[rank1]:     return func(*args, **kwargs)
[rank1]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 204, in perf_flux
[rank1]:     gemm_rs_op = cls(
[rank1]: RuntimeError: Could not retrieve or create the backend 2 for device type cuda
[rank2]: Traceback (most recent call last):
[rank2]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 367, in <module>
[rank2]:     perf_res_flux = perf_flux(
[rank2]:   File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
[rank2]:     return func(*args, **kwargs)
[rank2]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 204, in perf_flux
[rank2]:     gemm_rs_op = cls(
[rank2]: RuntimeError: Could not retrieve or create the backend 2 for device type cuda
[rank5]: Traceback (most recent call last):
[rank5]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 367, in <module>
[rank5]:     perf_res_flux = perf_flux(
[rank5]:   File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
[rank5]:     return func(*args, **kwargs)
[rank5]:   File "/home/tms/flux/./test/test_gemm_rs.py", line 204, in perf_flux
[rank5]:     gemm_rs_op = cls(
[rank5]: RuntimeError: Could not retrieve or create the backend 2 for device type cuda
E0628 20:25:08.343000 140061210293376 torch/distributed/elastic/multiprocessing/api.py:826] failed (exitcode: 1) local_rank: 0 (pid: 2980343) of binary: /home/tms/flux/test_env/bin/python3
Traceback (most recent call last):
  File "/home/tms/flux/test_env/bin/torchrun", line 33, in <module>
    sys.exit(load_entry_point('torch', 'console_scripts', 'torchrun')())
  File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 347, in wrapper
    return f(*args, **kwargs)
  File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/distributed/run.py", line 879, in main
    run(args)
  File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/distributed/run.py", line 870, in run
    elastic_launch(
  File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 132, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
  File "/home/tms/flux/test_env/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 263, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
============================================================
./test/test_gemm_rs.py FAILED
------------------------------------------------------------
Failures:
[1]:
  time      : 2024-06-28_20:25:08
  host      : bunsen
  rank      : 1 (local_rank: 1)
  exitcode  : 1 (pid: 2980344)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[2]:
  time      : 2024-06-28_20:25:08
  host      : bunsen
  rank      : 2 (local_rank: 2)
  exitcode  : 1 (pid: 2980345)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[3]:
  time      : 2024-06-28_20:25:08
  host      : bunsen
  rank      : 3 (local_rank: 3)
  exitcode  : 1 (pid: 2980346)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[4]:
  time      : 2024-06-28_20:25:08
  host      : bunsen
  rank      : 4 (local_rank: 4)
  exitcode  : 1 (pid: 2980347)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[5]:
  time      : 2024-06-28_20:25:08
  host      : bunsen
  rank      : 5 (local_rank: 5)
  exitcode  : 1 (pid: 2980348)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[6]:
  time      : 2024-06-28_20:25:08
  host      : bunsen
  rank      : 6 (local_rank: 6)
  exitcode  : 1 (pid: 2980349)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[7]:
  time      : 2024-06-28_20:25:08
  host      : bunsen
  rank      : 7 (local_rank: 7)
  exitcode  : 1 (pid: 2980350)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2024-06-28_20:25:08
  host      : bunsen
  rank      : 0 (local_rank: 0)
  exitcode  : 1 (pid: 2980343)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================

Environment Information

python collect_env.py                             tms@bunsen
Collecting environment information...
PyTorch version: 2.3.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

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 3.29.6
Libc version: glibc-2.35

Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-107-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.5.40
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA A100-SXM4-80GB
GPU 1: NVIDIA A100-SXM4-80GB
GPU 2: NVIDIA A100-SXM4-80GB
GPU 3: NVIDIA A100-SXM4-80GB
GPU 4: NVIDIA A100-SXM4-80GB
GPU 5: NVIDIA A100-SXM4-80GB
GPU 6: NVIDIA A100-SXM4-80GB
GPU 7: NVIDIA A100-SXM4-80GB

Nvidia driver version: 550.54.15
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      46 bits physical, 57 bits virtual
Byte Order:                         Little Endian
CPU(s):                             128
On-line CPU(s) list:                0-127
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Xeon(R) Platinum 8462Y+
CPU family:                         6
Model:                              143
Thread(s) per core:                 2
Core(s) per socket:                 32
Socket(s):                          2
Stepping:                           8
BogoMIPS:                           5600.00
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 invpcid_single cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities
Virtualization:                     VT-x
L1d cache:                          3 MiB (64 instances)
L1i cache:                          2 MiB (64 instances)
L2 cache:                           128 MiB (64 instances)
L3 cache:                           120 MiB (2 instances)
NUMA node(s):                       2
NUMA node0 CPU(s):                  0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126
NUMA node1 CPU(s):                  1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127
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: Not affected
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; Enhanced IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] mypy==1.9.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.26.4
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] sentence-transformers==3.0.1
[pip3] torch==2.3.0
[pip3] torchvision==0.18.0
[pip3] transformers==4.42.3
[pip3] triton==2.3.0
[conda] Could not collect
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: N/A
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: 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  NV12    NV12    NV12    NV12    NV12    NV12    NV12    PXB SYS SYS SYS SYS SYS SYS SYS 0,2,4,6,8,10    0       N/A
GPU1    NV12     X  NV12    NV12    NV12    NV12    NV12    NV12    SYS PXB SYS SYS SYS SYS SYS SYS 0,2,4,6,8,10    0       N/A
GPU2    NV12    NV12     X  NV12    NV12    NV12    NV12    NV12    SYS SYS PXB SYS SYS SYS SYS SYS 0,2,4,6,8,10    0       N/A
GPU3    NV12    NV12    NV12     X  NV12    NV12    NV12    NV12    SYS SYS SYS PXB SYS SYS SYS SYS 0,2,4,6,8,10    0       N/A
GPU4    NV12    NV12    NV12    NV12     X  NV12    NV12    NV12    SYS SYS SYS SYS PXB SYS SYS SYS 1,3,5,7,9,11    1       N/A
GPU5    NV12    NV12    NV12    NV12    NV12     X  NV12    NV12    SYS SYS SYS SYS SYS PXB SYS SYS 1,3,5,7,9,11    1       N/A
GPU6    NV12    NV12    NV12    NV12    NV12    NV12     X  NV12    SYS SYS SYS SYS SYS SYS PXB SYS 1,3,5,7,9,11    1       N/A
GPU7    NV12    NV12    NV12    NV12    NV12    NV12    NV12     X  SYS SYS SYS SYS SYS SYS SYS PXB 1,3,5,7,9,11    1       N/A
NIC0    PXB SYS SYS SYS SYS SYS SYS SYS  X  SYS SYS SYS SYS SYS SYS SYS             
NIC1    SYS PXB SYS SYS SYS SYS SYS SYS SYS  X  SYS SYS SYS SYS SYS SYS             
NIC2    SYS SYS PXB SYS SYS SYS SYS SYS SYS SYS  X  SYS SYS SYS SYS SYS             
NIC3    SYS SYS SYS PXB SYS SYS SYS SYS SYS SYS SYS  X  SYS SYS SYS SYS             
NIC4    SYS SYS SYS SYS PXB SYS SYS SYS SYS SYS SYS SYS  X  SYS SYS SYS             
NIC5    SYS SYS SYS SYS SYS PXB SYS SYS SYS SYS SYS SYS SYS  X  SYS SYS             
NIC6    SYS SYS SYS SYS SYS SYS PXB SYS SYS SYS SYS SYS SYS SYS  X  SYS             
NIC7    SYS SYS SYS SYS SYS SYS SYS PXB SYS SYS SYS SYS SYS SYS SYS  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
wenlei-bao commented 4 months ago

@tlrmchlsmth Did you build with --nvshmem or no? I didn't reproduce this on my end, I will try the other build option.

tlrmchlsmth commented 4 months ago

@wenlei-bao I'm not using --nvshmem

wenlei-bao commented 4 months ago

@tlrmchlsmth I am trying that build, at meanwhile, can you please try add --nvshmem when build?

wenlei-bao commented 4 months ago

@tlrmchlsmth NVD, please use the script to run, I think it maybe because of that. Below is the result without using --nvshmem option.

$ ./scripts/launch.sh test/test_gemm_rs.py 1024 1024 1024 --iters=10

SOL time for GEMM(M=1024,N=1024,K=1024,TP=8): 0.001ms
torch #0: gemm 0.015 ms, comm 0.448 ms, total 0.464 ms
torch #1: gemm 0.332 ms, comm 0.116 ms, total 0.448 ms
torch #2: gemm 0.332 ms, comm 0.116 ms, total 0.448 ms
torch #3: gemm 0.013 ms, comm 0.452 ms, total 0.465 ms
torch #4: gemm 0.013 ms, comm 0.452 ms, total 0.465 ms
torch #5: gemm 0.016 ms, comm 0.449 ms, total 0.465 ms
torch #6: gemm 0.013 ms, comm 0.452 ms, total 0.466 ms
torch #7: gemm 0.015 ms, comm 0.449 ms, total 0.464 ms
flux  #0: gemm 0.021 ms, comm 0.067 ms, total 0.088 ms
flux  #1: gemm 0.037 ms, comm 0.051 ms, total 0.088 ms
flux  #2: gemm 0.036 ms, comm 0.036 ms, total 0.072 ms
flux  #3: gemm 0.021 ms, comm 0.068 ms, total 0.089 ms
flux  #4: gemm 0.021 ms, comm 0.067 ms, total 0.089 ms
flux  #5: gemm 0.022 ms, comm 0.066 ms, total 0.088 ms
flux  #6: gemm 0.021 ms, comm 0.068 ms, total 0.089 ms
flux  #7: gemm 0.021 ms, comm 0.067 ms, total 0.088 ms
tlrmchlsmth commented 4 months ago

whoops, I mis-copied the line I used to run -- I am using ./scripts/launch.sh test/test_gemm_rs.py 1024 1024 1024

BTW it's failing the exact same way when I try to use it in my vLLM PR

wenlei-bao commented 4 months ago

Ah, OK. So is this a separated build and test run of flux (test_gemm_rs.py ) on your machine? Or after integration? Depends on that, we might need to use the vLLM branch to reproduce. cc @zheng-ningxin

tlrmchlsmth commented 4 months ago

No, this was with a completely fresh clone of flux, fresh venv, so the repro shouldn't depend on vLLM.

Just now as suggested, I rebuilt with --nvshmem and now I see success:

./scripts/launch.sh test/test_gemm_rs.py 4096 12288 49152 --iters=10                                                    tms@bunsen
torchrun --node_rank=0 --nproc_per_node=8 --nnodes=1 --rdzv_endpoint=127.0.0.1:23456 test/test_gemm_rs.py 4096 12288 49152 --iters=10
W0628 21:14:24.716000 140121298232448 torch/distributed/run.py:757]
W0628 21:14:24.716000 140121298232448 torch/distributed/run.py:757] *****************************************
W0628 21:14:24.716000 140121298232448 torch/distributed/run.py:757] Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
W0628 21:14:24.716000 140121298232448 torch/distributed/run.py:757] *****************************************
before flux shm initialization
before flux shm initialization
before flux shm initialization
before flux shm initialization
before flux shm initialization
before flux shm initialization
before flux shm initialization
before flux shm initialization
WARN: init failed for remote transport: ibrc
WARN: init failed for remote transport: ibrc
WARN: init failed for remote transport: ibrc
WARN: init failed for remote transport: ibrc
WARN: init failed for remote transport: ibrc
WARN: init failed for remote transport: ibrc
WARN: init failed for remote transport: ibrc
WARN: init failed for remote transport: ibrc
after flux shm initializationafter flux shm initializationafter flux shm initializationafter flux shm initialization

after flux shm initializationafter flux shm initialization

after flux shm initialization
after flux shm initialization
SOL time for GEMM(M=4096,N=12288,K=49152,TP=8): 1.982ms
torch #0: gemm 2.764 ms, comm 0.522 ms, total 3.286 ms
torch #1: gemm 2.764 ms, comm 0.522 ms, total 3.286 ms
torch #2: gemm 2.768 ms, comm 0.518 ms, total 3.286 ms
torch #3: gemm 2.769 ms, comm 0.520 ms, total 3.289 ms
torch #4: gemm 2.646 ms, comm 0.638 ms, total 3.284 ms
torch #5: gemm 2.723 ms, comm 0.563 ms, total 3.286 ms
torch #6: gemm 2.785 ms, comm 0.502 ms, total 3.287 ms
torch #7: gemm 2.768 ms, comm 0.519 ms, total 3.287 ms
flux  #0: gemm 2.780 ms, comm 0.090 ms, total 2.870 ms
flux  #1: gemm 2.777 ms, comm 0.092 ms, total 2.870 ms
flux  #2: gemm 2.785 ms, comm 0.085 ms, total 2.870 ms
flux  #3: gemm 2.782 ms, comm 0.088 ms, total 2.870 ms
flux  #4: gemm 2.308 ms, comm 0.561 ms, total 2.870 ms
flux  #5: gemm 2.322 ms, comm 0.548 ms, total 2.870 ms
flux  #6: gemm 2.469 ms, comm 0.401 ms, total 2.870 ms
flux  #7: gemm 2.325 ms, comm 0.545 ms, total 2.870 ms
wenlei-bao commented 4 months ago

@tlrmchlsmth OK. Interesting. Is this on A100 NVlink, right? As you see my other comment, I also build without nvshmem. There might be some issue, let me try a clean build.

tlrmchlsmth commented 4 months ago

Yeah that's right. I'm adding the output of vllm's collect_env.py as well.

wenlei-bao commented 4 months ago

@tlrmchlsmth I tried a clean build without nvshmem on my side, I still cannot reproduce the issue. It runs without issue on my side. @zheng-ningxin have you seen this before?

zheng-ningxin commented 4 months ago

@tlrmchlsmth I tried a clean build without nvshmem on my side, I still cannot reproduce the issue. It runs without issue on my side. @zheng-ningxin have you seen this before?

No, I haven’t seen this issue before. I’ll try to reproduce it today and take a look.

zheng-ningxin commented 4 months ago

I have reproduced this issue. I found that this issue only occurs when using torch==2.3. I switched to torch2.1 and this problem no longer exists. I will continue to investigate. @tlrmchlsmth @wenlei-bao

tlrmchlsmth commented 4 months ago

Great! Yes, I can confirm I am on torch==2.3.

houqi commented 4 months ago

Great! Yes, I can confirm I am on torch==2.3.

solved here https://github.com/bytedance/flux/pull/13