intel / intel/llm-scaler

[omni_xpu_kernel] Lumina/Z-Image / SDXL 模型在 Arc B580 上测试报告(oneAPI 2026.1)

Open
#548 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
529
Forks
80
Avg merge
9h 7m
Merged PRs (30d)
38

Description

既然 @xiangyuT 负责这部分,那我就写中文。 oneAPI 2025.3 编译,测试错误过多,直接升级到 2026.1,错误少了很多

---
### 环境

| 组件 | 值 |
|---|---|
| GPU | Intel Arc B580 (BMG / Xe2-HPG) |
| 驱动/工具链 | oneAPI 2026.1.0 |
| Python | 3.13.11 |
| PyTorch | 2.13.0+xpu |
| omni_xpu_kernel | 0.1.0-b8-dev(源码编译) |
| oneDNN | 2026.0 |
| 系统 | Windows 10 22H2 |
| ComfyUI | 0.28.0 |
| 测试模型 | z-image-turbo-fp8-e4m3fn(Lumina / NextDiT)z-image-turbo-int8-convrot |
| 测试模型 | IL-Gembyte_20Emerald(SDXL) |

---

### 测试结果

| 模块 | Lumina/Z-Image | SDXL | 状态 |
|---|---|---|---|
| RMSNorm | ✅ 正常 | ✅ 正常 | 通过 |
| LayerNorm | — | ✅ 正常 | 通过 |
| ESIMD Flash Attention | ✅ 正常 | ✅ 正常 | 通过 |
| RoPE | ✅ 正常 | ✅ 正常 | 通过 |
| FP8 GEMM | ✅ 正常 | — | 通过 |
| INT8 Linear | ❄️ 输出雪花 | — | 不兼容 |
| lgrf_sdp.pyd 加载 | ⚠️ 需复制纯名文件 | ⚠️ 需复制纯名文件 | 待修复 |

---

### INT8 Linear 详细跟踪

`z-image-turbo-int8-convrot` 模型(混合精度 `int8_tensorwise + fp8_e4m3fn`)的 INT8 层在 comfy_kitchen dispatch 路径下输出雪花。

**交叉验证**:脱离 comfy_kitchen,直接调用 `omni_xpu_kernel.int8.int8_linear()` 相同形状完全正常:
```python
from omni_xpu_kernel import int8
x = torch.randn(1, 416, 3840, device='xpu', dtype=torch.bfloat16)
w_int8, w_scale = int8.quantize_int8_rowwise(torch.randn(11520, 3840, device='xpu'))
out = int8.int8_linear(x, w_int8, w_scale, out_dtype=torch.bfloat16) # PASS
```

尝试过 `.contiguous()`、`.clone()`、`F.linear` 反量化回退均无效。怀疑 `comfy_kitchen` 的 tensor dispatch 与 oneDNN 引擎状态冲突。

---

### 已知问题

1. **INT8 Linear**:comfy_kitchen dispatch 路径下输出雪花,建议默认 `OMNIXPU_INT8=0`
2. **lgrf_sdp.pyd 加载**(Windows only):`sdp.cpp` 第 94 行 `LoadLibraryW(L"lgrf_sdp.pyd")` 不匹配 setuptools 生成的 `.cp313-win_amd64.pyd` 后缀。临时解决:复制文件

### 启动配置

```cmd
:: Lumina/Z-Image(关 INT8)
set OMNIXPU_INT8=0
python main.py --lowvram --reserve-vram 1.0 --preview-method none --use-pytorch-cross-attention

:: SDXL(全开)
python main.py --lowvram --reserve-vram 1.0 --preview-method none --use-pytorch-cross-attention
```

新增 Flux 架构测试结果,追加在表格后:

---

### Flux 架构测试

| 模型 | OmniXPU 开 | OmniXPU 关 | 结论 |
|------|-----------|-----------|------|
| Krea2 INT4 (convrot_w4a4) | ❌ 121 s/it | ✅ 6 s/it | OmniXPU 负优化,建议关闭 |
| Flux2 FP8 (float8_e4m3fn) | ⚠️ 23 s/it | ✅ 6 s/it | 无显著提升,Flux 架构不在此优化范围 |
| Krea2 GGUF | ❌ 无加速标识 | ✅ 正常 | GGUF 内部走 llm.cpp,OmniXPU 碰不到 |

**Flux 架构启动配置**:
```cmd
set OMNIXPU_ENABLE=0
python main.py --lowvram --reserve-vram 1.0 --preview-method none --use-pytorch-cross-attention
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported INT8 Linear behavior through the comfy_kitchen dispatch path and compare it with the direct omni_xpu_kernel.int8.int8_linear() example. Then inspect sdp.cpp line 94 and the generated Windows .cp313-win_amd64.pyd name. Done means the dispatch path no longer produces snowflake output and lgrf_sdp.pyd loads without manually copying a renamed file.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python, pytorch
Domain
backend, performance, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.