interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / backend / amd / kfd / launch / PLAN.md

46 lines · 4385 bytes Raw Blame History Source

OMPLAN01: one decode plan for the native Omega launcher

This is the native launcher's binary plan contract. First-party plan emitters record the model's dispatch list and checkpoint byte ranges. Production execution loads weights directly; external controls may embed deliberately altered vectors.

CLI: omega-launch plan PLAN CODE_0 .. CODE_{n_code-1} WEIGHT_0 .. WEIGHT_{n_file-1}; argc = 3 + n_code + n_file. Weight arguments follow the order chosen by the emitter; the model fixture lists that order in PLAN.json files. The reader validates each file independently. All plan, file and ELF bounds are validated before /dev/kfd is opened. Little-endian throughout.

Layout (absolute file offsets)

Header, 64 bytes: "OMPLAN01", then u64 n_code, n_file, n_buf, n_disp, n_prompt, n_gen, tok_buf.

Code table, n_code x 16: u64 name_offset (relative to the string pool), u64 name_length. Name = kernel symbol; code object i is CLI argument CODE_i. Group segment, private segment and kernarg size come from the validated kernel descriptor (symbol.kd), not from the plan.

Buffer table, n_buf x 48: u64 bytes, kind, file_index, file_offset, file_length, flags.

Prompt ids: n_prompt x i32, then zero padding to the next multiple of 8.

Dispatch table, n_disp entries in order, each:

String pool, then data pool immediately after it, then a 32-byte trailer immediately after the data pool: u64 string_pool_offset, string_pool_length, data_pool_offset, data_pool_length (absolute).

Execution

Packets in table order, barrier bit on every packet (same strict order as the HIP stream), completion signal on the last packet of each step; the optional trailing CLI timeout is per step, with zero/default meaning unlimited. A step over 10 s emits an alarm without refusing it. Only a caller-selected positive deadline exits 75. The dispatch list is identical every step (device step counter step_advance), so packet templates and VRAM kernargs are built once. The ring holds the whole step, grows by powers of two from 16 packets, and is bounded by the UAPI's 32-bit byte-size field. Body copying and aligned header publication are separate phases with CPU fences; one write-pointer/doorbell publication releases each step. Output per step: OMEGA_STEP i tok=T us=U (us = launcher wall clock from first packet write to signal). Final line OMEGA_PLAN ids=[...] with the n_gen generated tokens.

Model fixture gate