#6366 [Engine] Build the Battlemage TLA prompt attention by default from a sycl-tla submodule

open · draft · @xiangyuT · 0 comentarios · En GitHub

DocumentationLinux

Descripción

## Problem and result

The FP32 TLA prompt attention compiles only when the builder supplies a sycl-tla checkout. Without one, the standard build and the release package keep the INT8 ESIMD kernel on Battlemage.

This PR adds [intel/sycl-tla](https://github.com/intel/sycl-tla) as a git submodule at `engine/third_party/sycl-tla`, pinned at `87f6850680a580654b9ea2c80dbc01aeb36ad231`, and makes it the default header tree. A checkout with the submodule builds TLA with no extra option. The CI SYCL job and the release script check the submodule out.

| Build, no TLA option given | Before | After (submodule checked out) |
|---|---|---|
| Portable JIT (the release configuration) | TLA left out | TLA built |
| `bmg-g21`, `bmg-g31` or both | TLA left out | TLA built |
| Portable JIT engine size | 59,474,968 bytes (TLA off) | 59,799,208 bytes (+0.55%) |

## Related discussion

Depends on #6365, which makes Battlemage prefer TLA whenever TLA is built and documents a manual sycl-tla checkout. #6364 gives the precision and speed data.

This PR is a proposal. The repository vendors its other third-party code, and this would be its first submodule, so the packaging choice is the repository owner's. We propose a submodule rather than a vendored copy for three reasons:
- the kernel reads 180 sycl-tla headers, about 7 MB;
- the full list has to be collected from both the host and the device compilation passes; a list taken from the host pass alone missed two SPIR-V headers;
- the copy would need refreshing on every kernel or pin change.

The submodule pins the exact upstream commit without copying it into this repository's history. An earlier revision of this PR vendored exactly that header subset; the validation below covers both.

## Approach

- **Submodule.** `.gitmodules` and a gitlink point `engine/third_party/sycl-tla` at `https://github.com/intel/sycl-tla.git`, commit `87f6850680a580654b9ea2c80dbc01aeb36ad231`. `shallow = true` fetches that one commit.
- **CMake.**
  - `STRATA_SYCL_TLA_DIR` defaults to the submodule path. A build tree whose cache holds the former empty default switches to it on the next configure.
  - Without the submodule checked out, `AUTO` configures TLA off. Its warning names the missing headers and the command `git submodule update --init engine/third_party/sycl-tla`.
  - `ON` turns the missing headers into an error, and `OFF` leaves TLA out.
  - `-DSTRATA_SYCL_TLA_DIR` still builds from another checkout.
- **CI.** The SYCL job's checkout fetches submodules.
- **Release script.** `tools/packaging/build_sycl_linux.sh` initializes the submodule when its headers are missing in a git checkout. If that fails it prints a warning, and the build continues without TLA.
- **Docs.** `docs/INTEL_ARC.md` adds the init command to the Docker and the plain build recipes. The TLA section covers the submodule, another checkout (`-DSTRATA_SYCL_TLA_DIR`, or `TLA_DIR` for the Docker build) and source archives without git.
- **Settings register.** The note for `STRATA_SYCL_TLA_ATTN` describes the new default.

## Validation

Base: `main` at `3142b66b96e9c0e775e30f620b11b191a1427c2a` (after 0.2.17). This PR's own change is `5dd139d7c3f3f71a89ba32442f149d303332e846`, plus the merge `1f0a8292d3cce40778e8e662ad1358d8d697974d`, which brought in #6365's two later commits; the branch carries #6365's commits through `86311130aee3873444f062bcf5d9c31094d9fa38`. The merge keeps both the submodule default and #6365's cache migration in `engine/sycl/CMakeLists.txt`, and the submodule recipe in `docs/INTEL_ARC.md` with a note on existing build folders under step 2. It also recomputes the register's TLA entries. Please review `5dd139d7` and the merge; the diff shrinks to them once #6365 is merged.

`5dd139d7` and #6365's first commit were rebased from `58ee3227720629ff2e41d640165ebe89c880dfef`; only the generated settings register needed resolving. After the rebase, sycl-tla `87f6850` sat at the submodule path with no TLA option given. The portable JIT build configured TLA on and built (`strata` 59,865,832 bytes), and on B70 the three `qsa_bmg_*` CTests passed. At the merge, the same JIT build configured TLA on from the submodule path and built (`strata` 59,866,352 bytes), and on B70 the three `qsa_bmg_*` CTests passed. The settings register check and its unit tests, the launcher test, `tools/check_vendored.py` and `tools/check --only docs` passed. The results below were measured before the rebase.

| Item | Setting |
|---|---|
| GPU | Arc Pro B70: Xe2 (Battlemage), PCI ID `8086:e223`, 32,656 MiB reported by xpu-smi |
| Host | Ubuntu 24.04.2 LTS, Linux 6.17.0-1007-intel; Xeon w5-3435X, 1 socket, 16 cores / 32 threads |
| Container | Ubuntu 24.04.5 LTS; oneAPI icpx 2026.1.1; compute runtime and ocloc 26.31.39395.16; Level Zero loader 1.32.0; builds with `--parallel 8` |
| Model check | Flash-Next GSQ-RCO IQ2_XS, INT8 KV, MTP spec 4, PCIe share 0.29; `taskset -c 0-10,12-15` and `--host-core last`, 12 stager threads; one client, fresh prompts, 256 generated tokens |

**Passed:**

- **Fresh clone.** A blobless clone of this branch, then `git submodule update --init engine/third_party/sycl-tla`. It fetched only `87f6850680a580654b9ea2c80dbc01aeb36ad231` (`--is-shallow-repository`: true): 65 MB of git objects, 133 MB checked out.
- **Submodule not checked out.** Configuring with an empty submodule path gives TLA off. The warning names both missing headers and the init command.
- **Submodule checked out.** sycl-tla at `87f6850` sat at the submodule path, with no TLA option given. A portable JIT configure reports TLA on. The build produced a 59,799,208-byte `strata` and `qsa_prompt_attn_parity`, and the three `qsa_bmg_*` CTests passed on B70.
- **Earlier revision of this change.** It held a copy of the 180 headers the compiler reads, taken from the same sycl-tla commit; its portable JIT engine had the same size, 59,799,208 bytes. Its results therefore carry over:
  - `bmg-g31`: 114,337,368 bytes, and the `qsa_bmg_*` CTests passed.
  - `-DSTRATA_SYCL_TLA_ATTN=OFF`: 59,474,968 bytes.
  - The TLA object compiles in 9.3 s (JIT) or 9.6 s (`bmg-g31`).
  - The default JIT engine logged `using SYCL TLA FP32 prompt attention` on three measured 2K requests. It generated the same three 256-token sequences as the `bmg-g31` AOT engine of #6365.
- **Checks.** `tools/settings_register.py --check`, `tools/check_vendored.py` (its trees are unchanged) and `python tools/check --only docs` passed.

**Failed:**

None.

**Not run:**

- The CI SYCL job.
- The release script end to end.
- A checkout with `git clone --recurse-submodules`.
- Runtime on Battlemage GPUs other than B70.

## Limits

- A checkout has to fetch the submodule: about 65 MB of git objects and 133 MB on disk. The build reads only `include/`.
- GitHub source archives and `git archive` do not contain submodules. `docs/INTEL_ARC.md` gives the archive-of-the-commit route for them.

<details><summary>Commands</summary>

```sh
git submodule update --init engine/third_party/sycl-tla
git -C engine/third_party/sycl-tla rev-parse HEAD             # 87f6850680a580654b9ea2c80dbc01aeb36ad231
git -C engine/third_party/sycl-tla rev-parse --is-shallow-repository
source /opt/intel/oneapi/setvars.sh
cmake -G Ninja -S engine/sycl -B build-jit -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_COMPILER=icx -DSTRATA_SYCL_PARITY=ON
cmake --build build-jit --parallel 8 --target strata qsa_prompt_attn_parity
ctest --test-dir build-jit -R '^qsa_bmg_' --output-on-failure
python3 tools/settings_register.py --check
python3 tools/check_vendored.py
python tools/check --only docs
```

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

En el sitio

Enlaces a install, modelos, releases.