Skip to content

OutOfMemoryError #329

Description

@squirrelfish

model: nvidia/GLM-5.2-NVFP4
device: 8*A100

log:
Loading expert weights - 97.4% ..
Loading expert weights - 98.7% ..
Loading expert weights - 100.0% ..
Synchronizing with other peers..

CUDA graph initialized for bsz = 1: TPS = 56.176.
[rank6]: Traceback (most recent call last):
[rank6]: File "/opt/deepseek-tutel-accel/llm_moe_tutel.py", line 1292, in
[rank6]: build_cugraph()
[rank6]: File "/opt/deepseek-tutel-accel/llm_moe_tutel.py", line 797, in build_cugraph
[rank6]: step_once(bsz)
[rank6]: File "/opt/deepseek-tutel-accel/llm_moe_tutel.py", line 782, in
[rank6]: step_once = lambda bsz: forward_fn(batched_given_tokens[:bsz], batched_positions[max_concurrency:max_concurrency + bsz + 1], batched_pred_tokens[:bsz], max_pos=args.max_seq_len - 1)
[rank6]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank6]: File "/opt/deepseek-tutel-accel/./model_deepseek_moe.py", line 441, in forward_fn
[rank6]: splitData = torch.empty([chunk_size, _MAX_KV_SPLITS.value, Q.size(-2), 512], dtype=torch.float32, device=device)[:samples]
[rank6]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank6]: torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 512.00 MiB. GPU 6 has a total capacity of 79.33 GiB of which 405.81 MiB is free. Of the allocated memory 77.38 GiB is allocated by PyTorch
, with 1.02 GiB allocated in private pools (e.g., CUDA Graphs), and 763.27 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable
_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions