compileiq-author-objective
БесплатноЗапускает вложенные скриптыНе проверенUse when writing the objective_function= passed to Search(). Covers the two legal signatures (compiler-only str vs mixed list), the baseline-knockout branch…
от NVIDIA★ 4 269 звёзд на GitHubОб этом скилле
compileiq-author-objective
The objective function is where ~80% of CompileIQ user errors happen. This
skill tells you the exact shape it must have for current CompileIQ, how to
inject --apply-controls for each supported compile path, and how to verify
the whole pipeline works before paying for a full search.
For paste-ready full-file templates per framework, see
references/templates.md.
When
- Writing a brand-new objective function.
- Migrating an older objective off the legacy
bytes.fromhex(config_blob)pattern. - Diagnosing "every config returns the same score" or "TypeError: fromhex".
The two legal signatures
Shape of search_space= |
Objective signature | What config is |
|---|---|---|
Single provider, e.g. PtxasSearchSpace() |
def objective(config: str) -> float |
A hex string. Pass it straight to save_compiler_config(acf_path, config). |
List, e.g. [{"k": ss.choice(...)}, PtxasSearchSpace()] |
def objective(mixed: list) -> float |
A list of the same length. Unpack: user_space, ptxas_config = mixed, but check for BASELINE_CONFIG first (see below). |
Mixed-space results keep the same list shape in best["params"]. Unpack it
before saving the ACF, for example:
user_space, ptxas_config = best["params"]. (Pattern reference:
examples/compilers/triton_example/mixed_triton.py.)
For multi-objective, return tuple[float, ...] of length num_objectives.
Canonical imports
from compileiq.types import INVALID_SCORE, BASELINE_CONFIG
from compileiq.utils.helpers import save_compiler_config
INVALID_SCORE is CompileIQ's sentinel — return it on any failure (compile,
hang, wrong answer, exception). Do not redefine it as float('inf').
BASELINE_CONFIG is the empty-dict sentinel ({}) CompileIQ passes for a
baseline run. With normalize=True the first task of the search is always a
baseline run; without normalization it can still appear when knockout
removes every parameter. It is {} whatever the search-space shape, including
mixed (list) spaces.
save_compiler_config(path, hex_str) writes the binary blob to disk; it
handles the bytes.fromhex internally (compileiq/utils/helpers.py:128-137).
Users never need to touch fromhex themselves.
Self-contained for IsoMultiProcessWorker and Ray
Heavy library imports (torch, triton, helion, cute) go inside the function
so the process IsoMultiProcessWorker spawns — or the remote Ray task — can
re-import them in a clean state. Cheap module-level constants (paths, regexes)
are fine.
Per-eval cache busting (non-negotiable)
import os, tempfile
# Set at the start of each evaluation, inside the objective's process.
os.environ["TRITON_ALWAYS_COMPILE"] = "1"
os.environ["HELION_SKIP_CACHE"] = "1"
os.environ["TRITON_CACHE_DIR"] = tempfile.mkdtemp(prefix="ciq_triton_")
If the benchmark runs in a subprocess instead, prefix its command with the same
three variables (for example TRITON_ALWAYS_COMPILE=1 TRITON_CACHE_DIR=... python bench.py).
For FlashInfer, additionally confirm the prebuilt cubin cache packages are
absent — flashinfer_cubin and flashinfer_jit_cache. See
docs/flashinfer_booster.md for the import-time check.
Per-framework --apply-controls injection
| Target | Injection |
|---|---|
Raw PTXAS (you have a .ptx file) |
ptxas --apply-controls candidate.acf kernel.ptx -arch=sm_100 -o kernel.cubin |
NVCC source (CUDA .cu) |
nvcc --apply-controls candidate.acf -arch=sm_100 kernel.cu -o exe, which applies the ACF to every stage it lists (nvcc and ptxas). This form needs a Blackwell or later target (-arch=sm_100 and up): for earlier targets such as sm_90, nvcc rejects --apply-controls and the build fails, even for a ptxas-only ACF. There, use nvcc -Xptxas --apply-controls=candidate.acf ..., which reaches ptxas only and silently ignores any nvcc-stage controls in the ACF. |
| Triton kernel | launch keyword argument ptx_options=f"--apply-controls={acf_path}" on the kernel launch (Triton 3.4+) plus TRITON_ALWAYS_COMPILE=1, os.environ["TRITON_PTXAS_PATH"] = shutil.which("ptxas"), and os.environ["TRITON_PTXAS_BLACKWELL_PATH"] = shutil.which("ptxas") when Blackwell-specific PTXAS selection may apply. Use this inside objectives; see the PTXAS_OPTIONS gotcha below. |
| Helion | Helion's official ACF API. See https://helionlang.com/examples/acfs/softmax_acf.html. Always set HELION_SKIP_CACHE=1. |
| cuTeDSL / FA4 (TVM-FFI) | cute.compile(..., options=f"{existing_options} --ptxas-options '--apply-controls {acf_path}'"). If you can't reach the call site, patch CompileCallable.__call__ to splice in the option string. |
| FlashInfer | FLASHINFER_EXTRA_CUDAFLAGS="--ptxas-options=--apply-controls=$ACF_FILE" (see [docs/flashinfer_booster.md](https://gi |
Установить compileiq-author-objective в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadВложенные файлы
FAQ
Что делает скилл compileiq-author-objective?
Use when writing the objective_function= passed to Search(). Covers the two legal signatures (compiler-only str vs mixed list), the baseline-knockout branch, per-eval cache busting, framework-specific --apply-controls injection (raw PTXAS, NVCC, Triton, Helion, cuTeDSL/FA4, FlashInfer), correctness-before-timing, INVALID_SCORE handling, and the Debug-pack O0/O3 ACF-injection canary that must pass before launching a search. Triggers on "objective function", "apply-controls", "INVALID_SCORE", "save_compiler_config", "baseline knockout", "BASELINE_CONFIG", "every config returns the same score", "TypeError fromhex".
Как установить скилл compileiq-author-objective?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл compileiq-author-objective запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic