Skip to content

[Bug]: Stuck When Launching Llama-4-Maverick-17B-128E-Instruct-FP8 #16152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
HermitSun opened this issue Apr 7, 2025 · 14 comments
Open
1 task done

[Bug]: Stuck When Launching Llama-4-Maverick-17B-128E-Instruct-FP8 #16152

HermitSun opened this issue Apr 7, 2025 · 14 comments
Labels
bug Something isn't working

Comments

@HermitSun
Copy link
Contributor

Your current environment

The output of `python collect_env.py`
INFO 04-07 11:37:47 [__init__.py:239] Automatically detected platform cuda.
Collecting environment information...
/usr/local/lib/python3.10/dist-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
PyTorch version: 2.6.0+cu124
Is debug build: False
CUDA used to build PyTorch: 12.4
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.28.1
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-94-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.3.107
CUDA_MODULE_LOADING set to: LAZY
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: 535.129.03
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.9.0.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv.so.9.0.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn.so.9.0.0
/usr/lib/x86_64-linux-gnu/libcudnn_engines_precompiled.so.9.0.0
/usr/lib/x86_64-linux-gnu/libcudnn_engines_runtime_compiled.so.9.0.0
/usr/lib/x86_64-linux-gnu/libcudnn_graph.so.9.0.0
/usr/lib/x86_64-linux-gnu/libcudnn_heuristic.so.9.0.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops.so.9.0.0
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:                      52 bits physical, 57 bits virtual
Byte Order:                         Little Endian
CPU(s):                             192
On-line CPU(s) list:                0-191
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Xeon(R) Platinum 8468V
CPU family:                         6
Model:                              143
Thread(s) per core:                 2
Core(s) per socket:                 48
Socket(s):                          2
Stepping:                           8
CPU max MHz:                        3800.0000
CPU min MHz:                        800.0000
BogoMIPS:                           4800.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 intel_ppin 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 hwp hwp_act_window hwp_epp hwp_pkg_req 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:                          4.5 MiB (96 instances)
L1i cache:                          3 MiB (96 instances)
L2 cache:                           192 MiB (96 instances)
L3 cache:                           195 MiB (2 instances)
NUMA node(s):                       2
NUMA node0 CPU(s):                  0-47,96-143
NUMA node1 CPU(s):                  48-95,144-191
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
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.4.5.8
[pip3] nvidia-cuda-cupti-cu12==12.4.127
[pip3] nvidia-cuda-nvrtc-cu12==12.4.127
[pip3] nvidia-cuda-runtime-cu12==12.4.127
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.2.1.3
[pip3] nvidia-curand-cu12==10.3.5.147
[pip3] nvidia-cusolver-cu12==11.6.1.9
[pip3] nvidia-cusparse-cu12==12.3.1.170
[pip3] nvidia-cusparselt-cu12==0.6.2
[pip3] nvidia-dali-cuda120==1.34.0
[pip3] nvidia-ml-py==12.560.30
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.4.127
[pip3] nvidia-nvtx-cu12==12.4.127
[pip3] nvidia-pyindex==1.0.9
[pip3] onnx==1.15.0rc2
[pip3] optree==0.15.0
[pip3] pynvml==11.4.1
[pip3] pytorch-quantization==2.1.2
[pip3] pyzmq==25.1.2
[pip3] torch==2.6.0
[pip3] torch-tensorrt==2.3.0a0
[pip3] torchaudio==2.6.0
[pip3] torchdata==0.7.1a0
[pip3] torchtext==0.17.0a0
[pip3] torchvision==0.21.0
[pip3] transformers==4.51.0
[pip3] triton==3.2.0
[conda] No relevant packages
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.8.3
vLLM Build Flags:
CUDA Archs: 5.2 6.0 6.1 7.0 7.2 7.5 8.0 8.6 8.7 9.0+PTX; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    GPU1    GPU2    GPU3    GPU4    GPU5    GPU6    GPU7    NIC0    NIC1    NIC2    NIC3    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      NV18    NV18    NV18    NV18    NV18    NV18    NV18    PIX     SYS     SYS     SYS     0-47,96-143     0               N/A
GPU1    NV18     X      NV18    NV18    NV18    NV18    NV18    NV18    SYS     SYS     SYS     SYS     0-47,96-143     0               N/A
GPU2    NV18    NV18     X      NV18    NV18    NV18    NV18    NV18    SYS     PIX     SYS     SYS     0-47,96-143     0               N/A
GPU3    NV18    NV18    NV18     X      NV18    NV18    NV18    NV18    SYS     SYS     SYS     SYS     0-47,96-143     0               N/A
GPU4    NV18    NV18    NV18    NV18     X      NV18    NV18    NV18    SYS     SYS     PIX     SYS     48-95,144-191   1               N/A
GPU5    NV18    NV18    NV18    NV18    NV18     X      NV18    NV18    SYS     SYS     SYS     SYS     48-95,144-191   1               N/A
GPU6    NV18    NV18    NV18    NV18    NV18    NV18     X      NV18    SYS     SYS     SYS     PIX     48-95,144-191   1               N/A
GPU7    NV18    NV18    NV18    NV18    NV18    NV18    NV18     X      SYS     SYS     SYS     SYS     48-95,144-191   1               N/A
NIC0    PIX     SYS     SYS     SYS     SYS     SYS     SYS     SYS      X      SYS     SYS     SYS
NIC1    SYS     SYS     PIX     SYS     SYS     SYS     SYS     SYS     SYS      X      SYS     SYS
NIC2    SYS     SYS     SYS     SYS     PIX     SYS     SYS     SYS     SYS     SYS      X      SYS
NIC3    SYS     SYS     SYS     SYS     SYS     SYS     PIX     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

NVIDIA_VISIBLE_DEVICES=GPU-3a6d9eec-13d8-bfca-3668-204ab09379ef,GPU-ab44c55b-99b1-5821-d382-150b233fb39f,GPU-080dc61b-a2d8-4a88-e73f-c9d1f7d30a95,GPU-06cb9a7c-4cc5-3d1f-66a8-7e6c621ae217,GPU-5071dd6b-acd5-ed2a-009b-141e51d820eb,GPU-4cd47a10-6313-7393-37e7-7367f08bc018,GPU-6a1fb276-f409-db79-f944-53dfb0f7ddc6,GPU-e4ed4b90-5883-a84c-e913-8f4bf558b85a
CUBLAS_VERSION=12.3.4.1
NVIDIA_REQUIRE_CUDA=cuda>=9.0
CUDA_CACHE_DISABLE=1
TORCH_CUDA_ARCH_LIST=5.2 6.0 6.1 7.0 7.2 7.5 8.0 8.6 8.7 9.0+PTX
NCCL_VERSION=2.19.stable.20231214+cuda12.3
NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
VLLM_WORKER_MULTIPROC_METHOD=spawn
NVIDIA_PRODUCT_NAME=PyTorch
CUDA_VERSION=
PYTORCH_VERSION=2.3.0a0+ebedce2
PYTORCH_BUILD_NUMBER=0
MAX_JOBS=64
CUDNN_VERSION=9.0.0.306
PYTORCH_HOME=/opt/pytorch/pytorch
LD_LIBRARY_PATH=/usr/local/cuda/compat/lib.real:/usr/local/lib/python3.10/dist-packages/torch/lib:/usr/local/lib/python3.10/dist-packages/torch_tensorrt/lib:/usr/local/cuda/compat/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64
NVIDIA_BUILD_ID=82611821
CUDA_DRIVER_VERSION=545.23.08
PYTORCH_BUILD_VERSION=2.3.0a0+ebedce2
CUDA_HOME=/usr/local/cuda
CUDA_HOME=/usr/local/cuda
CUDA_MODULE_LOADING=LAZY
NVIDIA_REQUIRE_JETPACK_HOST_MOUNTS=
NVIDIA_PYTORCH_VERSION=24.02
TORCH_ALLOW_TF32_CUBLAS_OVERRIDE=1
NCCL_CUMEM_ENABLE=0
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1

🐛 Describe the bug

When attempting to launch the vLLM server using the following command from the documentation, and after the model finished loading, it has been stuck there for over ten hours.

vllm serve meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8 -tp 8 --max-model-len 128000 --load-format runai_streamer --override-generation-config='{"attn_temperature_tuning": true}' --kv-cache-dtype fp8

Logs:

(VllmWorker rank=6 pid=20691) WARNING 04-07 11:11:48 [kv_cache.py:82] Checkpoint does not provide a q scaling factor. Setting it to k_scale. This only matters for the flash-attn backend.
(VllmWorker rank=6 pid=20691) WARNING 04-07 11:11:48 [kv_cache.py:95] Using KV cache scaling factor 1.0 for fp8_e4m3. This may cause accuracy issues. Please make sure k/v_scale scaling factors are available in the fp8 checkpoint.
(VllmWorker rank=6 pid=20691) INFO 04-07 11:11:48 [gpu_model_runner.py:1273] Model loading took 48.8682 GiB and 117.477290 seconds
(VllmWorker rank=7 pid=20772) WARNING 04-07 11:11:49 [kv_cache.py:82] Checkpoint does not provide a q scaling factor. Setting it to k_scale. This only matters for the flash-attn backend.
(VllmWorker rank=7 pid=20772) WARNING 04-07 11:11:49 [kv_cache.py:95] Using KV cache scaling factor 1.0 for fp8_e4m3. This may cause accuracy issues. Please make sure k/v_scale scaling factors are available in the fp8 checkpoint.
(VllmWorker rank=7 pid=20772) INFO 04-07 11:11:50 [gpu_model_runner.py:1273] Model loading took 48.8682 GiB and 118.276868 seconds
(VllmWorker rank=5 pid=20608) WARNING 04-07 11:11:51 [kv_cache.py:82] Checkpoint does not provide a q scaling factor. Setting it to k_scale. This only matters for the flash-attn backend.
(VllmWorker rank=5 pid=20608) WARNING 04-07 11:11:51 [kv_cache.py:95] Using KV cache scaling factor 1.0 for fp8_e4m3. This may cause accuracy issues. Please make sure k/v_scale scaling factors are available in the fp8 checkpoint.
(VllmWorker rank=5 pid=20608) INFO 04-07 11:11:51 [gpu_model_runner.py:1273] Model loading took 48.8682 GiB and 120.344785 seconds

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.
@HermitSun HermitSun added the bug Something isn't working label Apr 7, 2025
@ywang96 ywang96 moved this to Backlog in Llama Issues & Bugs Apr 7, 2025
@gaoxt1983
Copy link

The same as me

@sarckk
Copy link
Collaborator

sarckk commented Apr 7, 2025

@HermitSun can you try seeing if it works without --load-format runai_streamer? I seem to have problem with this load format but without it, it works fine

@sarckk sarckk moved this from Backlog to In progress in Llama Issues & Bugs Apr 7, 2025
@gaoxt1983
Copy link

@HermitSun can you try seeing if it works without --load-format runai_streamer? I seem to have problem with this load format but without it, it works fine

For me, it still happens

@HermitSun
Copy link
Contributor Author

@HermitSun can you try seeing if it works without --load-format runai_streamer? I seem to have problem with this load format but without it, it works fine

After waiting for over 10 mins, it did work fine. It seems the model loading step took quite a while.

(VllmWorker rank=7 pid=18131) INFO 04-08 12:58:13 [gpu_model_runner.py:1273] Model loading took 48.8682 GiB and 732.479859 seconds
(VllmWorker rank=5 pid=17971) INFO 04-08 12:58:13 [gpu_model_runner.py:1273] Model loading took 48.8682 GiB and 732.111469 seconds
(VllmWorker rank=1 pid=17702) INFO 04-08 12:58:13 [gpu_model_runner.py:1273] Model loading took 48.8682 GiB and 732.169150 seconds
(VllmWorker rank=6 pid=18046) INFO 04-08 12:58:13 [gpu_model_runner.py:1273] Model loading took 48.8682 GiB and 731.621731 seconds
(VllmWorker rank=4 pid=17895) INFO 04-08 12:58:13 [gpu_model_runner.py:1273] Model loading took 48.8682 GiB and 731.876249 seconds
(VllmWorker rank=0 pid=17654) INFO 04-08 12:58:13 [gpu_model_runner.py:1273] Model loading took 48.8682 GiB and 731.636212 seconds
(VllmWorker rank=3 pid=17818) INFO 04-08 12:58:13 [gpu_model_runner.py:1273] Model loading took 48.8682 GiB and 732.047441 seconds
(VllmWorker rank=2 pid=17758) INFO 04-08 12:58:13 [gpu_model_runner.py:1273] Model loading took 48.8682 GiB and 733.054542 seconds

@noa-neria
Copy link

noa-neria commented Apr 8, 2025

@HermitSun @sarckk Could you please specify the version of runai-model-streamer you're using?
A recent release (0.13.0) resolved a bug that caused the streamer to hang when encountering zero-size tensors in model weights

If that is the problem, version 0.13.0 should fix it

@HermitSun
Copy link
Contributor Author

@HermitSun @sarckk Could you please specify the version of runai-model-streamer you're using? A recent release (0.13.0) resolved a bug that caused the streamer to hang when encountering zero-size tensors in model weights

If that is the problem, version 0.13.0 should fix it

I'm on version 0.13.0.

@sarckk
Copy link
Collaborator

sarckk commented Apr 9, 2025

over 10mins is definitely not normal. I'm not able to reproduce this long of a load time from my end.

@HermitSun
Copy link
Contributor Author

Could this be related to the file system I'm using? I chose runai_streamer because GPFS has performance issues when loading safetensors.

@omer-dayan
Copy link
Contributor

omer-dayan commented Apr 9, 2025

Hey @HermitSun

The reason I suspect it takes such long time is the fact the loader is currently neither support sharded mode loading nor multi-gpu loading.

What actually happen is that every rank (8 in your case) read the entire model (400GB) and take only small portion of the files.
This results in unoptimized reading, as every process read from the file-system the same exact data, and thus, the reading procedure is slow.

The solution to that would be to make sure that the data is read once, and gets to the appropriate rank.

The following PR add support for sharded mode with RunAI Model Streamer: #16317
This require you to first shard your model to files according to the number of ranks you expect to run, according to the following script (https://docs.vllm.ai/en/latest/getting_started/examples/save_sharded_state.html).

We are working on more sophisticated mechanism of reading to multiple GPUs in an optimized way, without the need to shard the model first

Thanks, Omer

@noa-neria
Copy link

noa-neria commented Apr 9, 2025

@HermitSun if the safetensors files in GPFS have direct I/O policy set then the page caching is disabled. With direct I/O the files are read directly from storage 8 times instead of utilizing the page cache.
The policy can be checked with mmlsattr -l <filename> - if flag directio is present then direct I/O is configured

@omer-dayan
Copy link
Contributor

Also notice that in the command you run vllm serve meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8... the model location is HuggingFace and not a local file.

That means the process will download the model from the internet if its not exists in the cache, and only then will load it to the GPU. That's definitely not the recommended way to get the best performance.

In your counting, you dont take the download process into account right?
In addition, have you configured the HuggingFace cache directory to be on your desired file-system?

@HermitSun
Copy link
Contributor Author

HermitSun commented Apr 10, 2025

Also notice that in the command you run vllm serve meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8... the model location is HuggingFace and not a local file.还请注意,在您运行的命令 vllm serve meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8... 中,模型位置是 HuggingFace 而不是本地文件。

That means the process will download the model from the internet if its not exists in the cache, and only then will load it to the GPU. That's definitely not the recommended way to get the best performance.这意味着如果模型不在缓存中,进程将从互联网下载模型,然后再将其加载到 GPU 上。这肯定不是获得最佳性能的推荐方法。

In your counting, you dont take the download process into account right?在你的计数中,你没有将下载过程考虑在内,对吗? In addition, have you configured the HuggingFace cache directory to be on your desired file-system?另外,你是否已经将 HuggingFace 缓存目录配置为你希望的文件系统?

The model has already been downloaded to GPFS — I simulated the download behavior by linking the cache from GPFS to some required paths. To avoid any potential impact from symlinks (or anything others), I used the following command to read from the absolute path on GPFS:

vllm serve /models/preset/meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8 -tp 8 --max-model-len 128000 --override-generation-config='{"attn_temperature_tuning": true}' --kv-cache-dtype fp8

Since I'm using Kubernetes, each start should theoretically be in a clean environment, and I’m able to consistently reproduce this result. In fact, loading the model weights wasn't slow — it seems some steps after the weights are read took quite a while. I'm wondering what happened after weights loaded🤔:

Loading safetensors checkpoint shards:  79% Completed | 66/84 [00:13<00:03,  5.01it/s]
Loading safetensors checkpoint shards:  80% Completed | 67/84 [00:13<00:04,  3.93it/s]
Loading safetensors checkpoint shards:  81% Completed | 68/84 [00:14<00:04,  3.28it/s]
Loading safetensors checkpoint shards:  83% Completed | 70/84 [00:14<00:04,  3.28it/s]
Loading safetensors checkpoint shards:  86% Completed | 72/84 [00:15<00:02,  4.32it/s]
Loading safetensors checkpoint shards:  88% Completed | 74/84 [00:15<00:02,  3.93it/s]
Loading safetensors checkpoint shards:  90% Completed | 76/84 [00:15<00:01,  5.05it/s]
Loading safetensors checkpoint shards:  93% Completed | 78/84 [00:16<00:00,  6.09it/s]
Loading safetensors checkpoint shards:  94% Completed | 79/84 [00:16<00:00,  5.35it/s]
Loading safetensors checkpoint shards:  95% Completed | 80/84 [00:16<00:00,  5.74it/s]
Loading safetensors checkpoint shards:  98% Completed | 82/84 [00:17<00:00,  4.57it/s]
Loading safetensors checkpoint shards:  99% Completed | 83/84 [00:17<00:00,  4.23it/s]
Loading safetensors checkpoint shards: 100% Completed | 84/84 [00:17<00:00,  3.34it/s]
Loading safetensors checkpoint shards: 100% Completed | 84/84 [00:17<00:00,  4.69it/s]
(VllmWorker rank=6 pid=5399) INFO 04-10 10:31:20 [loader.py:447] Loading weights took 680.75 seconds

The following result is from restarting the service within the same pod, where local cache should already exist — and it's noticeably faster:

Loading safetensors checkpoint shards:  29% Completed | 24/84 [00:00<00:02, 25.35it/s]
Loading safetensors checkpoint shards:  33% Completed | 28/84 [00:01<00:02, 27.81it/s]
Loading safetensors checkpoint shards:  40% Completed | 34/84 [00:01<00:01, 33.60it/s]
Loading safetensors checkpoint shards:  45% Completed | 38/84 [00:01<00:01, 34.31it/s]
Loading safetensors checkpoint shards:  57% Completed | 48/84 [00:01<00:00, 41.45it/s]
Loading safetensors checkpoint shards:  63% Completed | 53/84 [00:01<00:00, 33.67it/s]
Loading safetensors checkpoint shards:  69% Completed | 58/84 [00:01<00:00, 32.58it/s]
Loading safetensors checkpoint shards:  79% Completed | 66/84 [00:01<00:00, 38.90it/s]
Loading safetensors checkpoint shards:  85% Completed | 71/84 [00:02<00:00, 28.85it/s]
Loading safetensors checkpoint shards:  89% Completed | 75/84 [00:02<00:00, 30.26it/s]
Loading safetensors checkpoint shards:  98% Completed | 82/84 [00:02<00:00, 33.28it/s]
Loading safetensors checkpoint shards: 100% Completed | 84/84 [00:02<00:00, 31.03it/s]
(VllmWorker rank=6 pid=30882) INFO 04-10 09:52:20 [loader.py:447] Loading weights took 38.56 seconds

@HermitSun
Copy link
Contributor Author

HermitSun commented Apr 10, 2025

@HermitSun if the safetensors files in GPFS have direct I/O policy set then the page caching is disabled. With direct I/O the files are read directly from storage 8 times instead of utilizing the page cache. The policy can be checked with mmlsattr -l <filename> - if flag directio is present then direct I/O is configured

I've noticed that safetensors uses mmap during loading — is this always done with direct I/O?

@noa-neria
Copy link

While mmap interacts with the page cache by default, it doesn't inherently enforce or prevent Direct I/O

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants