multimodalart HF Staff commited on
Commit
b8a88fb
·
1 Parent(s): 134049c

Fix ZeroGPU Blackwell AttributeError and CUDA kernel error

Browse files

- Add missing use_fp8_gemm/quant_type/include_patterns attrs to the
ArgsNamespace shim passed to initialize_infer_state (upstream's
InferState dataclass reads them unconditionally).
- Pin torch/torchvision/torchaudio to a compatible triplet (2.10.0 /
0.25.0 / 2.10.0); the previous torchvision==0.21.0 pin forced pip to
downgrade torch to 2.6.0, which predates Blackwell (sm_120) support
and caused 'CUDA error: no kernel image is available'.
- Install flash-attn from the prebuilt Blackwell (sm_120) wheel instead
of the plain PyPI wheel, which lacks sm_120 kernels.

Files changed (2) hide show
  1. app.py +10 -2
  2. requirements.txt +3 -2
app.py CHANGED
@@ -1,5 +1,10 @@
1
  import subprocess
2
- subprocess.run('pip install flash-attn==2.7.4.post1 --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
 
 
 
 
 
3
 
4
  import os
5
  import sys
@@ -232,7 +237,10 @@ class ArgsNamespace:
232
  self.cache_end_step = 45
233
  self.total_steps = 50
234
  self.cache_step_interval = 4
235
-
 
 
 
236
 
237
  initialize_infer_state(ArgsNamespace())
238
 
 
1
  import subprocess
2
+ # Prebuilt flash-attn wheel matching torch==2.10.0 / cu128 / cp310, built with Blackwell (sm_120) kernels.
3
+ # The plain PyPI wheel for flash-attn has no sm_120 kernels and fails at runtime with
4
+ # "CUDA error: no kernel image is available for execution on the device" on ZeroGPU's
5
+ # RTX PRO 6000 Blackwell hardware.
6
+ FLASH_ATTN_WHEEL = "https://huggingface.co/datasets/multimodalart/zerogpu-blackwell-wheels/resolve/main/wheels/pt210-cu128-cp310/flash_attn-2.7.4.post1-cp310-cp310-linux_x86_64.whl"
7
+ subprocess.run(f'pip install {FLASH_ATTN_WHEEL}', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
8
 
9
  import os
10
  import sys
 
237
  self.cache_end_step = 45
238
  self.total_steps = 50
239
  self.cache_step_interval = 4
240
+ self.use_fp8_gemm = False
241
+ self.quant_type = "fp8-per-token-sgl"
242
+ self.include_patterns = "double_blocks"
243
+
244
 
245
  initialize_infer_state(ArgsNamespace())
246
 
requirements.txt CHANGED
@@ -11,10 +11,11 @@ pillow==11.3.0
11
  imageio==2.37.0
12
  imageio-ffmpeg==0.6.0
13
  omegaconf>=2.3.0
14
- torchaudio==2.6.0
 
15
  diffusers==0.35.0
16
  safetensors==0.4.5
17
- torchvision==0.21.0
18
  qwen-vl-utils==0.0.8
19
  huggingface-hub==0.34.0
20
  huggingface_hub[cli]
 
11
  imageio==2.37.0
12
  imageio-ffmpeg==0.6.0
13
  omegaconf>=2.3.0
14
+ torch==2.10.0
15
+ torchaudio==2.10.0
16
  diffusers==0.35.0
17
  safetensors==0.4.5
18
+ torchvision==0.25.0
19
  qwen-vl-utils==0.0.8
20
  huggingface-hub==0.34.0
21
  huggingface_hub[cli]