Skip to content

ci: compile every declared CUDA backend - #101

Draft
xiaoyu-xyz wants to merge 2 commits into
ThinkFlowLab:mainfrom
xiaoyu-xyz:tier2-ci
Draft

xiaoyu-xyz wants to merge 2 commits into
ThinkFlowLab:mainfrom
xiaoyu-xyz:tier2-ci

Conversation

@xiaoyu-xyz

Copy link
Copy Markdown
Contributor

Purpose

contract.md describes three validation tiers. Tier 1 is the contract checker, Tier 3 needs a card — and Tier 2, compile, has never been wired up, so nothing in CI has compiled a .cu file.

This adds it. The job reads the manifests, runs each backend's own build script with an output directory and its default compute capability, and requires the library the manifest names. Adding a backend needs no edit here, and one failure does not hide the others: the whole set is reported before the job fails.

No GPU and no self-hosted runner. nvcc cross-compiles for a target it is not running on, and nothing here runs what it builds. The container carries nvcc and cuBLASLt, and the TileLang the Laya recipe records is installed because that backend's export needs it. Only Tier 3, which executes kernels, needs hardware.

Test Result

Merge order

Depends on the preceding commit, the Laya TileLang target pin: without it Laya's export falls back to -arch=sm_50 and this job cannot be green. This is stacked, so it shows that commit too until it lands.

Related: Tier 1 for this contract is #25, and the qwen3_5 manifest is #77.

`@tilelang.jit` was called without a target, so TileLang resolved one at
export time: `determine_target("auto")` returns `auto_detect_target()`,
which yields the bare string `cuda`, and TVM's CUDA codegen then picks the
architecture from whatever it can detect. With no device attached it cannot
detect the CUDA version, warns, and defaults to `-arch=sm_50`, which nvcc
rejects with `Unsupported gpu architecture 'sm_50'`. CUDA 12.6 fails too,
elsewhere, inside TileLang's own `tl_templates/cuda/common.h`.

So the export only ran where a Hopper card was present, which is not a
property a build should have. Every other layer already states the target:
`tools/export.py` compiles the generated source with
`-gencode=arch=compute_90a,code=sm_90a`, `tools/build.py` records
`"arch": "sm_90a"`, `build.sh` refuses any other capability, and the READMEs
say `sm_90a` only.

`determine_target` rejects a target string that carries options ("Pass
target options as a dict"), so the target is given as a mapping.

Verified by building the backend on a runner with no GPU: export and link
both complete.
The contract's Tier 2 -- build each backend, so a kernel that stops
compiling cannot land -- was the only tier with no wiring at all, so
nothing in CI has ever compiled a `.cu` file.

The job reads the manifests, runs each backend's own build script with an
output directory and its default compute capability, and requires the
library the manifest names. Adding a backend needs no edit here, and one
failure does not hide the others.

No GPU and no self-hosted runner: nvcc cross-compiles for a target it is
not running on, and nothing here runs what it builds. The container carries
nvcc and cuBLASLt, and the TileLang the Laya recipe records is installed
because that backend's export needs it.

Depends on the TileLang target pin in the preceding commit: without it
Laya's export falls back to sm_50 and this job cannot be green.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants