Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel

## Unreleased

- Internal: HIP record counts are pinned in their owning arrays, so additions in different record files no longer edit a shared numeric total; omissions still fail host checks (#2461).

- Qwen3.5 and Qwen3.6 on CUDA: a stream's rollback copy shares its verify log's bytes, which are never in use together, so each pooled stream takes 147 MiB less on Qwen3.8-27B and 61 MiB less on the 35B-A3B; tokens and speed unchanged (#2447, part of #1943). Thanks to @jschmied.
- LightOnOCR-3 on HIP: the native server reads `lightonai/LightOnOCR-3-0.8B`, `-1B` and `-4B` (BF16) and serves their
OCR prompts, token-exact against Transformers apart from exact BF16 logit ties. With `--vision`, a Qwen 3.5 checkpoint
Expand Down
6 changes: 3 additions & 3 deletions zig/src/core/contract/hip_records.zig
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ fn relu2Tile(comptime rows: u32, comptime cb: u32) limits.HipLaunch {
.symbols = .{ half, brain, brain, brain },
};
}

pub const own_count: usize = 41;
/// HIP kernels as launched; tf-hip-kernel-contract limits DIR re-derives the usage records from the code objects.
const own_records = [_]Record{
const own_records = [own_count]Record{
.{
.launch = .{ .name = "RMS norm tf_rms_rows", .symbol = "tf_rms_rows", .image = "ops", .threads = 256 },
.usage = .{
Expand Down Expand Up @@ -501,7 +501,7 @@ pub const records = own_records ++ @import("hip_records_stream.zig").records ++
@import("hip_records_vision.zig").records ++ @import("hip_records_dense_text.zig").records ++ @import("hip_records_families.zig").all;

/// Gate 5's planted HIP controls: a launch past its __launch_bounds__, and 72 KiB of LDS where a workgroup has 64.
pub const controls = [_]Record{
pub const controls = [2]Record{
.{
.launch = .{
.name = "control: past its bounds",
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_columns.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Recorded launch resources for the BF16 column operators on each served HIP architecture.
const Record = @import("hip_records.zig").Record;

pub const records = [_]Record{
pub const records = [2]Record{
.{
.launch = .{ .name = "BF16 column multiply", .symbol = "tf_columns_mul_bf16", .image = "ops", .threads = 256 },
.usage = .{
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_dense_text.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Measured resources of dense BF16 text operators, in limits.rdna order.
const Record = @import("hip_records.zig").Record;

pub const records = [_]Record{
pub const records = [2]Record{
.{
.launch = .{ .name = "Dense BF16 embedding", .symbol = "tf_embed_bf16", .image = "ops", .threads = 256 },
.usage = .{
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_embed.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const limits = @import("limits.zig");
const Record = @import("hip_records.zig").Record;

pub const records = [_]Record{.{
pub const records = [1]Record{.{
.launch = .{ .name = "embedding gather tf_embed_dense", .symbol = "tf_embed_dense", .image = "ops", .threads = 256 },
.usage = .{
.{ .vgprs = 13, .sgprs = 21, .lds = 0, .private = 0, .bound = 1024, .wave = 32 },
Expand Down
29 changes: 25 additions & 4 deletions zig/src/core/contract/hip_records_families.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,29 @@ pub const all = join: {
break :join joined[0..joined.len].*;
};

test "the HIP records are main's and the families' own: GLM-OCR's, the joint schema's, LightOn's and the Qwen tower's" {
const every = @import("hip_records.zig").records;
try std.testing.expectEqual(@as(usize, 227), every.len); // includes Parse, LightOn and Qwen vision records
try std.testing.expectEqual(@as(usize, 184), every.len - all.len);
test "HIP record counts stay pinned in their owning files" {
const hip = @import("hip_records.zig");
const counts = .{
@import("hip_records_columns.zig").records.len,
@import("hip_records_dense_text.zig").records.len,
@import("hip_records_embed.zig").records.len,
@import("hip_records_glm_ocr.zig").records.len,
@import("hip_records_item.zig").records.len,
@import("hip_records_joint.zig").records.len,
@import("hip_records_lighton_ocr.zig").records.len,
@import("hip_records_pair.zig").records.len,
@import("hip_records_prompt.zig").records.len,
@import("hip_records_qwen3.zig").records.len,
@import("hip_records_qwen_vision.zig").records.len,
@import("hip_records_router.zig").records.len,
@import("hip_records_score.zig").records.len,
@import("hip_records_stream_plain.zig").records.len,
@import("hip_records_stream_swiglu.zig").records.len,
@import("hip_records_tail.zig").records.len,
@import("hip_records_tap.zig").records.len,
@import("hip_records_vision.zig").records.len,
};
var expected: usize = hip.own_count;
inline for (counts) |count| expected += count;
try std.testing.expectEqual(expected, hip.records.len);
}
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_glm_ocr.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Compiler-derived GLM-OCR launch usage on gfx1030, gfx1100, gfx1151 and gfx1201.
const Record = @import("hip_records.zig").Record;
pub const records = [_]Record{
pub const records = [12]Record{
.{ .launch = .{ .name = "GLM-OCR tf_glmocr_bias", .symbol = "tf_glmocr_bias", .image = "glm_ocr", .threads = 256 }, .usage = .{
.{ .vgprs = 12, .sgprs = 17, .lds = 0, .private = 0, .bound = 256, .wave = 32 },
.{ .vgprs = 12, .sgprs = 18, .lds = 0, .private = 0, .bound = 256, .wave = 32 },
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_item.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn itemTile(comptime rm: u32) limits.HipLaunch {
};
}

pub const records = [_]Record{
pub const records = [1]Record{
.{
.launch = itemTile(4),
.usage = .{
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_joint.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Gate 5's records of the joint schema head's kernels (joint_schema/joint_schema.hip): 256 threads a launch.
const Record = @import("hip_records.zig").Record;

pub const records = [_]Record{
pub const records = [10]Record{
.{
.launch = .{ .name = "joint schema layer norm tf_js_layer_norm", .symbol = "tf_js_layer_norm", .image = "joint_schema", .threads = 256 },
.usage = .{
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_lighton_ocr.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const std = @import("std");
const hip_records = @import("hip_records.zig");
const Record = hip_records.Record;

pub const records = [_]Record{
pub const records = [9]Record{
.{ .launch = .{ .name = "lighton_ocr tf_lo_tables", .symbol = "tf_lo_tables", .image = "lighton_ocr", .threads = 256 }, .usage = .{ .{ .vgprs = 15, .sgprs = 23, .lds = 0, .private = 0, .bound = 256, .wave = 32 }, .{ .vgprs = 24, .sgprs = 23, .lds = 0, .private = 0, .bound = 256, .wave = 32 }, .{ .vgprs = 15, .sgprs = 23, .lds = 0, .private = 0, .bound = 256, .wave = 32 }, .{ .vgprs = 15, .sgprs = 25, .lds = 0, .private = 0, .bound = 256, .wave = 32 } } },
.{ .launch = .{ .name = "lighton_ocr tf_lo_rotary", .symbol = "tf_lo_rotary", .image = "lighton_ocr", .threads = 256 }, .usage = .{ .{ .vgprs = 17, .sgprs = 27, .lds = 0, .private = 0, .bound = 256, .wave = 32 }, .{ .vgprs = 17, .sgprs = 27, .lds = 0, .private = 0, .bound = 256, .wave = 32 }, .{ .vgprs = 17, .sgprs = 27, .lds = 0, .private = 0, .bound = 256, .wave = 32 }, .{ .vgprs = 17, .sgprs = 29, .lds = 0, .private = 0, .bound = 256, .wave = 32 } } },
.{ .launch = .{ .name = "lighton_ocr tf_lo_merge", .symbol = "tf_lo_merge", .image = "lighton_ocr", .threads = 256 }, .usage = .{ .{ .vgprs = 13, .sgprs = 25, .lds = 0, .private = 0, .bound = 256, .wave = 32 }, .{ .vgprs = 13, .sgprs = 25, .lds = 0, .private = 0, .bound = 256, .wave = 32 }, .{ .vgprs = 13, .sgprs = 25, .lds = 0, .private = 0, .bound = 256, .wave = 32 }, .{ .vgprs = 13, .sgprs = 27, .lds = 0, .private = 0, .bound = 256, .wave = 32 } } },
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_pair.zig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn pairTile(comptime rows: u32, comptime cb: u32) limits.HipLaunch {
};
}

pub const records = [_]Record{
pub const records = [8]Record{
.{
.launch = pairTile(1, 2),
.usage = .{
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_prompt.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn promptTile(comptime symbol: []const u8, usage: [limits.rdna.len]U) Record {
return .{ .launch = .{ .name = name, .symbol = symbol, .image = "prefill", .threads = 256 }, .usage = usage };
}

pub const records = [_]Record{
pub const records = [8]Record{
promptTile("tf_fa_wide_f16", .{
.{ .vgprs = 230, .sgprs = 47, .lds = 40960, .private = 0, .bound = 256, .wave = 32 },
.{ .vgprs = 230, .sgprs = 47, .lds = 40960, .private = 0, .bound = 256, .wave = 32 },
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_qwen3.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const hip_records = @import("hip_records.zig");
const Record = hip_records.Record;
const check = hip_records.check;

pub const records = [_]Record{
pub const records = [4]Record{
.{
.launch = .{ .name = "attention tf_heads_rows", .symbol = "tf_heads_rows", .image = "ops", .threads = 256 },
.usage = .{
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_qwen_vision.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Compiler-derived Qwen vision and rounding-control usage on gfx1030, gfx1100, gfx1151 and gfx1201.
const Record = @import("hip_records.zig").Record;
pub const records = [_]Record{
pub const records = [12]Record{
.{
.launch = .{ .name = "Qwen vision tf_qvh_linear", .symbol = "tf_qvh_linear", .image = "qwen_vision", .threads = 32 },
.usage = .{
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_router.zig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn routeTile(comptime name: []const u8, comptime symbol: []const u8) Record {
}

/// The same launch in bf16, whose weights are the wider activation's rows.
pub const records = [_]Record{
pub const records = [2]Record{
routeTile("router tf_router_bf16_f16", "tf_router_bf16_f16"),
.{
.launch = .{ .name = "router tf_router_bf16", .symbol = "tf_router_bf16", .image = "decode", .threads = 128 },
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_score.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn shortScore(comptime symbol: []const u8, usage: [limits.rdna.len]U) Record {
return .{ .launch = .{ .name = name, .symbol = symbol, .image = "plan", .threads = 128, .dynamic = 16 * 128 * 4 }, .usage = usage };
}

pub const records = [_]Record{
pub const records = [4]Record{
shortScore("tf_plan_score2_f16", .{
.{ .vgprs = 31, .sgprs = 34, .lds = 0, .private = 0, .bound = 128, .wave = 32 },
.{ .vgprs = 31, .sgprs = 33, .lds = 0, .private = 0, .bound = 128, .wave = 32 },
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_stream_plain.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const Record = @import("hip_records.zig").Record;
const tile = @import("hip_records_stream.zig").tile;

pub const records = [_]Record{
pub const records = [48]Record{
.{
.launch = tile(2, 1, 2, false),
.usage = .{
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_stream_swiglu.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const Record = @import("hip_records.zig").Record;
const tile = @import("hip_records_stream.zig").tile;

pub const records = [_]Record{
pub const records = [48]Record{
.{
.launch = tile(2, 1, 2, true),
.usage = .{
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_tail.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Gate 5's record of the decode tail (decode.hip: tf_tail): a row a block of 512 threads, the row held in LDS.
const Record = @import("hip_records.zig").Record;

pub const records = [_]Record{.{
pub const records = [1]Record{.{
.launch = .{ .name = "decode tail tf_tail", .symbol = "tf_tail", .image = "decode", .threads = 512 },
.usage = .{
.{ .vgprs = 125, .sgprs = 58, .lds = 32832, .private = 0, .bound = 512, .wave = 32 },
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_tap.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Gate 5's records of a drafter's tap writes (plan.hip's tf_plan_tap for round rows, tf_tap_rows for prompt rows).
const Record = @import("hip_records.zig").Record;

pub const records = [_]Record{
pub const records = [2]Record{
.{
.launch = .{ .name = "drafter tap tf_plan_tap", .symbol = "tf_plan_tap", .image = "plan", .threads = 256 },
.usage = .{
Expand Down
2 changes: 1 addition & 1 deletion zig/src/core/contract/hip_records_vision.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Measured resources of the shared vision kernels, in limits.rdna order.
const Record = @import("hip_records.zig").Record;

pub const records = [_]Record{
pub const records = [12]Record{
.{
.launch = .{ .name = "BF16 LayerNorm", .symbol = "tf_layer_norm_bf16", .image = "ops", .threads = 256 },
.usage = .{
Expand Down
Loading