deepspeedai / deepspeedai/DeepSpeed

[BUG] DeepCompile in ZeRO-1 fails to do the forward pass

Open
#7,229 11 comments 0 reactions 1 assignee View on GitHub

@tohtana is already working on this.

Since Apr 18, 2025.

bug compiler
Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

Describe the bug
It looks like DeepCompile might have some compatibility issues with flash attention, when doing the forward pass.

Error logs:

MemoryProfiling error /pytorch/build/aten/src/ATen/RegisterCUDA.cpp:18503: SymIntArrayRef expected to contain only concrete integers

While executing %view : [num_users=2] = call_function[target=torch.ops.aten.view.default](args = (%arg1_1, [%arg0_1]), kwargs = {})
Original traceback:
  File "flash_attn/bert_padding.py", line 114, in torch_dynamo_resume_in_unpad_input_at_114
    indices = torch.nonzero(all_masks.flatten(), as_tuple=False).flatten()

To Reproduce
I'm using OpenRLHF with DeepCompile, but I think this should not be directly related to code in OpenRLHF and should be general enough to reproduce.

Basically, you may be able to reconstruct a reproduction script that, during training, run a forward pass when doing .eval() in ZeRO-1 with DeepCompile, for a huggingface model (meta-llama/Llama-3.2-1B-Instruct) with flash attention enabled (transformers==4.51.1, flash_attn==2.7.4.post1).

Expected behavior
No error thrown

ds_report output

--------------------------------------------------
DeepSpeed C++/CUDA extension op report
--------------------------------------------------
NOTE: Ops not installed will be just-in-time (JIT) compiled at
      runtime if needed. Op compatibility means that your system
      meet the required dependencies to JIT install the op.
--------------------------------------------------
JIT compiled ops requires ninja
ninja .................. [OKAY]
--------------------------------------------------
op name ................ installed .. compatible
--------------------------------------------------
 [WARNING]  async_io requires the dev libaio .so object and headers but these were not found.
 [WARNING]  async_io: please install the libaio-devel package with yum
 [WARNING]  If libaio is already installed (perhaps from source), try setting the CFLAGS and LDFLAGS environment variables to where it can be found.
async_io ............... [NO] ....... [NO]
fused_adam ............. [NO] ....... [OKAY]
cpu_adam ............... [NO] ....... [OKAY]
cpu_adagrad ............ [NO] ....... [OKAY]
cpu_lion ............... [NO] ....... [OKAY]
dc ..................... [NO] ....... [OKAY]
 [WARNING]  Please specify the CUTLASS repo directory as environment variable $CUTLASS_PATH
evoformer_attn ......... [NO] ....... [NO]
 [WARNING]  FP Quantizer is using an untested triton version (3.2.0), only 2.3.(0, 1) and 3.0.0 are known to be compatible with these kernels
fp_quantizer ........... [NO] ....... [NO]
fused_lamb ............. [NO] ....... [OKAY]
fused_lion ............. [NO] ....... [OKAY]
 [WARNING]  gds requires the dev libaio .so object and headers but these were not found.
 [WARNING]  gds: please install the libaio-devel package with yum
 [WARNING]  If libaio is already installed (perhaps from source), try setting the CFLAGS and LDFLAGS environment variables to where it can be found.
gds .................... [NO] ....... [NO]
transformer_inference .. [NO] ....... [OKAY]
inference_core_ops ..... [NO] ....... [OKAY]
cutlass_ops ............ [NO] ....... [OKAY]
quantizer .............. [NO] ....... [OKAY]
ragged_device_ops ...... [NO] ....... [OKAY]
ragged_ops ............. [NO] ....... [OKAY]
random_ltd ............. [NO] ....... [OKAY]
 [WARNING]  sparse_attn requires a torch version >= 1.5 and < 2.0 but detected 2.6
 [WARNING]  using untested triton version (3.2.0), only 1.0.0 is known to be compatible
sparse_attn ............ [NO] ....... [NO]
spatial_inference ...... [NO] ....... [OKAY]
transformer ............ [NO] ....... [OKAY]
stochastic_transformer . [NO] ....... [OKAY]
--------------------------------------------------
DeepSpeed general environment info:
torch version .................... 2.6.0+cu124
deepspeed info ................... 0.16.6, unknown, unknown
torch cuda version ............... 12.4
torch hip version ................ None
nvcc version ..................... 12.4
deepspeed wheel compiled w. ...... torch 2.6, cuda 12.4
shared memory (/dev/shm) size .... 251.75 GB

System info (please complete the following information):

  • OS: RHEL 9.5
  • 1 machines with x4 A100s each
  • transformers==4.51.1
  • flash_attn==2.7.4.post1
  • Python version: 3.12.9
  • OpenRLHF version: 0.7.1.post1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.