Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
c89e5c1
Collect B300 vLLM 0.25.0 operator measurements
simone-chen Sep 17, 2026
15b2b86
fix(data): withdraw B200 and B300 vLLM 0.24.0 measurements
simone-chen Sep 17, 2026
e4ab5c3
Revert "fix(data): withdraw B200 and B300 vLLM 0.24.0 measurements"
simone-chen Sep 17, 2026
99b0670
fix(perfmodel): restrict reuse of eager FP8-block GEMMs
simone-chen Sep 17, 2026
3aef988
fix(data): checkpoint H200 vLLM 0.25.0 and extend safe reuse
simone-chen Sep 17, 2026
5d58d48
fix(data): add verified GB200 GB300 and H100 collection checkpoints
simone-chen Sep 17, 2026
34b930e
fix(data): complete vLLM 0.25.0 Hopper collection
simone-chen Sep 17, 2026
efaeebe
fix(data): collect vLLM 0.25.0 Grace Blackwell operator tables
simone-chen Sep 17, 2026
4af4e9f
fix(data): recover GB300 MSA measurements and retain hang evidence
simone-chen Sep 17, 2026
1f29ee4
fix(data): finalize GB200 MSA collection
simone-chen Sep 17, 2026
56c7553
Remove collection diagnostics from packaged performance data
simone-chen Sep 17, 2026
af91885
fix(data): replace invalid FP8-block rows through declared reuse
simone-chen Sep 17, 2026
0a51476
test(data): qualify corrected FP8-block prediction baselines
simone-chen Sep 17, 2026
ec43e8c
test(perfmodel): refresh goldens for corrected FP8-block data
simone-chen Sep 17, 2026
f2dc14f
test(data): verify complete FP8-block reuse coverage
simone-chen Sep 17, 2026
58510e7
test: make collection evidence and GEMM reuse auditable
simone-chen Sep 18, 2026
36bd2f9
fix: reject anomalous collection evidence before writing
simone-chen Sep 18, 2026
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
189 changes: 170 additions & 19 deletions crates/core/src/perfmodel/perf_database/source_resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
//! 1. Active backend/version (primary). No `kernel_source` filter.
//! 2. Declared donors from the REQUESTED version dir's `reuse.yaml`
//! (design §6.3), in file order. The only channel that may borrow a
//! version NEWER than requested. No filter.
//! version NEWER than requested. Source-owned donor filter if declared.
//! 3. Same-backend siblings STRICTLY EARLIER than requested (design §6.2),
//! nearest first. No filter.
//! nearest first. Source-owned donor filter if declared.
//! 4. Cross-backend fill (design §6.4), kernel-identity gated by
//! `perf_data_reuse_manifest.yaml`, newest-first per framework.
//!
Expand Down Expand Up @@ -370,6 +370,7 @@ struct ReuseEntry {
/// MISSING top-level `reuse` key is a schema error.
fn parse_reuse_yaml(path: &Path) -> Result<Vec<ReuseEntry>, AicError> {
let mapping = load_yaml_mapping(path, "reuse.yaml")?;
donor_kernel_sources(&mapping, path)?;
let entries_value = mapping
.get(serde_yaml::Value::String("reuse".to_string()))
.ok_or_else(|| {
Expand Down Expand Up @@ -435,6 +436,56 @@ fn parse_reuse_yaml(path: &Path) -> Result<Vec<ReuseEntry>, AicError> {
Ok(validated)
}

/// Optional source-owned whitelist. It restricts this directory as a donor,
/// never its primary rows, and cannot broaden a cross-backend manifest filter.
fn donor_kernel_sources(
mapping: &serde_yaml::Mapping,
path: &Path,
) -> Result<BTreeMap<String, BTreeSet<String>>, AicError> {
let mut filters = BTreeMap::new();
let Some(value) = mapping.get("donor_kernel_sources") else {
return Ok(filters);
};
let entries = value.as_mapping().ok_or_else(|| {
perf_err(format!(
"{}: donor_kernel_sources must be a mapping",
path.display()
))
})?;
for (table, value) in entries {
let table = table
.as_str()
.filter(|s| !s.trim().is_empty())
.ok_or_else(|| {
perf_err(format!(
"{}: donor_kernel_sources table must be a non-empty string",
path.display()
))
})?;
let sources = value.as_sequence().ok_or_else(|| {
perf_err(format!(
"{}: donor_kernel_sources.{table} must be a list of non-empty strings",
path.display()
))
})?;
let mut allowed = BTreeSet::new();
for source in sources {
let source = source
.as_str()
.filter(|s| !s.trim().is_empty())
.ok_or_else(|| {
perf_err(format!(
"{}: donor_kernel_sources.{table} must be a list of non-empty strings",
path.display()
))
})?;
allowed.insert(source.to_string());
}
filters.insert(table.to_string(), allowed);
}
Ok(filters)
}

// ---------------------------------------------------------------------------
// Version-dir marker state (the ADMISSION-layer strict predicate; the
// resolver-side lenient existence check stays `version_dir_is_unusable`)
Expand Down Expand Up @@ -1001,23 +1052,46 @@ pub fn resolve_one(

let finish = |records: Vec<(String, PathBuf, &'static str, Option<BTreeSet<String>>)>,
warnings: Vec<ResolverWarning>| {
ResolveReport {
records: records
.into_iter()
.map(|(version, path, channel, ks_filter)| ResolvedRecord {
version,
exists: path.is_file(),
path: path.display().to_string(),
channel,
ks_filter,
})
.collect(),
warnings,
let mut resolved = Vec::with_capacity(records.len());
for (version, path, channel, mut ks_filter) in records {
if channel != "primary" {
let policy_path = path
.parent()
.unwrap_or(Path::new(""))
.join(REUSE_YAML_MARKER);
if policy_path.is_file() {
let mapping = load_yaml_mapping(&policy_path, "reuse.yaml")?;
let mut filters = donor_kernel_sources(&mapping, &policy_path)?;
if let Some(allowed) =
filters.remove(op_file_basename.trim_end_matches(".parquet"))
{
let allowed = match ks_filter {
Some(existing) => existing.intersection(&allowed).cloned().collect(),
None => allowed,
};
if allowed.is_empty() {
continue;
}
ks_filter = Some(allowed);
}
}
}
resolved.push(ResolvedRecord {
version,
exists: path.is_file(),
path: path.display().to_string(),
channel,
ks_filter,
});
}
Ok(ResolveReport {
records: resolved,
warnings,
})
};

if !ctx.enable_shared_layer || FRAMEWORK_AGNOSTIC_BASENAMES.contains(&op_file_basename) {
return Ok(finish(records, warnings));
return finish(records, warnings);
}

// Communication reuse is derived from the storage namespace. A direct
Expand All @@ -1029,11 +1103,11 @@ pub fn resolve_one(
if storage_backend != backend_lower
|| !FRAMEWORK_VERSIONED_COMM_BACKENDS.contains(&storage_backend)
{
return Ok(finish(records, warnings));
return finish(records, warnings);
}
Some(storage_backend.to_string())
} else if comm_namespace_ambiguous {
return Ok(finish(records, warnings));
return finish(records, warnings);
} else {
None
};
Expand Down Expand Up @@ -1183,7 +1257,7 @@ pub fn resolve_one(
// Framework-owned communication data uses only the primary plus the
// nearest-earlier same-storage-backend chain. Declared and
// cross-backend channels remain disabled for every comm table.
return Ok(finish(records, warnings));
return finish(records, warnings);
}

// Channel 4 (design §6.4): cross-backend fill, kernel-identity gated.
Expand Down Expand Up @@ -1289,7 +1363,7 @@ pub fn resolve_one(
}
}

Ok(finish(records, warnings))
finish(records, warnings)
}

// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -1460,6 +1534,83 @@ mod tests {
report.records.iter().map(|r| r.version.as_str()).collect()
}

#[test]
fn donor_whitelist_restricts_declared_implicit_and_cross_backend_only() {
let tmp = tempfile::tempdir().unwrap();
let root = tmp.path();
let donor = root.join("data/gemm/vllm/0.24.0");
write(&donor.join("gemm_perf.parquet"), "stub");
write(
&donor.join("reuse.yaml"),
"reuse: []\ndonor_kernel_sources:\n gemm_perf: [safe, unrelated]\n",
);
let primary = resolve_one(&ctx(root, "vllm", "0.24.0"), "gemm_perf.parquet", None).unwrap();
assert!(primary.records[0].ks_filter.is_none());
let fallback =
resolve_one(&ctx(root, "vllm", "0.25.0"), "gemm_perf.parquet", None).unwrap();
let source = fallback
.records
.iter()
.find(|r| r.channel == "fallback")
.unwrap();
assert_eq!(
source.ks_filter.as_ref().unwrap(),
&BTreeSet::from(["safe".into(), "unrelated".into()])
);
write(
&root.join("data/gemm/vllm/0.22.0/reuse.yaml"),
"reuse:\n- table: gemm_perf\n from_version: '0.24.0'\n reason: test\n approved_by: test\n",
);
let declared =
resolve_one(&ctx(root, "vllm", "0.22.0"), "gemm_perf.parquet", None).unwrap();
assert_eq!(
declared
.records
.iter()
.find(|r| r.channel == "declared_reuse")
.unwrap()
.ks_filter,
source.ks_filter
);
write(
&root.join("perf_data_reuse_manifest.yaml"),
"groups:\n- op_file: gemm_perf.parquet\n kernel_source: safe\n tier: shared\n frameworks: [sglang, vllm]\n- op_file: gemm_perf.parquet\n kernel_source: bad\n tier: shared\n frameworks: [sglang, vllm]\n",
);
let cross = resolve_one(&ctx(root, "sglang", "0.5.14"), "gemm_perf.parquet", None).unwrap();
let source = cross
.records
.iter()
.find(|r| r.channel == "cross_backend")
.unwrap();
assert_eq!(
source.ks_filter.as_ref().unwrap(),
&BTreeSet::from(["safe".into()])
);
}

#[test]
fn empty_donor_whitelist_denies_table_and_malformed_policy_fails_closed() {
let tmp = tempfile::tempdir().unwrap();
let root = tmp.path();
let donor = root.join("data/gemm/vllm/0.24.0");
write(&donor.join("gemm_perf.parquet"), "stub");
write(
&donor.join("reuse.yaml"),
"reuse: []\ndonor_kernel_sources:\n gemm_perf: []\n",
);
let report = resolve_one(&ctx(root, "vllm", "0.25.0"), "gemm_perf.parquet", None).unwrap();
assert!(report.records.iter().all(|r| r.channel != "fallback"));
for invalid in ["null", "[]", "{gemm_perf: bad}", "{gemm_perf: [null]}"] {
write(
&donor.join("reuse.yaml"),
&format!("reuse: []\ndonor_kernel_sources: {invalid}\n"),
);
let error =
resolve_one(&ctx(root, "vllm", "0.25.0"), "gemm_perf.parquet", None).unwrap_err();
assert!(error.to_string().contains("donor_kernel_sources"));
}
}

#[test]
fn full_channel_order_declared_then_fallback_nearest_then_cross_backend() {
let tmp = tempfile::tempdir().unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,37 @@ have been invalidated by it, so backward fill preserves historical
reproducibility; forward fill silently answers "how fast is 0.5.14" with
0.5.15's kernels.

### Donor kernel restrictions

A source directory can restrict which of its kernels may be reused through an
optional `donor_kernel_sources` mapping in its own `reuse.yaml`. Keys are table
stems; values are lists of exact `kernel_source` labels. For example:

```yaml
schema_version: 1
reuse: []
donor_kernel_sources:
gemm_perf:
- torch.nn.functional.linear
- CutlassFP8ScaledMMLinearKernel
- FlashInferCuteDslNvFp4LinearKernel
```

- The restriction applies when this directory is a declared donor, an implicit
earlier-version donor, or a cross-backend donor. It intersects the existing
cross-backend filter and never expands that filter.
- An absent table key leaves that table unrestricted; an empty list prevents
that table from donating any rows. Malformed donor filters fail closed,
including when strict provenance is disabled.
- Primary reads are unchanged. This does not remove, relabel, or certify any
historical measurements. Queries explicitly requesting the old version still
see its primary rows.
- B200/B300/GB200/GB300 and H100/H200 SXM vLLM 0.24.0 GEMM use this policy
to retain BF16, ordinary FP8 and supported NVFP4 reuse while excluding
FP8-block kernels whose eager timings
include host launch gaps (PR #219). Fresh 0.25.0 rows with those same kernel
names remain usable; the restriction belongs to the 0.24.0 source directory.

### 6.3 Channel 2 — declared reuse (`reuse.yaml`, same backend, any direction)

When we *know* data is valid for a version we never collected — typically a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,15 @@ def _parse_reuse_yaml(path: str) -> dict:
if not isinstance(entries, list):
raise ValueError(f"{path}: 'reuse' must be a list, got {type(entries).__name__}")

donor_filters = raw.get("donor_kernel_sources", {})
if not isinstance(donor_filters, dict):
raise ValueError(f"{path}: donor_kernel_sources must be a mapping")
for table, sources in donor_filters.items():
if not isinstance(table, str) or not table.strip():
raise ValueError(f"{path}: donor_kernel_sources table must be a non-empty string")
if not isinstance(sources, list) or any(not isinstance(s, str) or not s.strip() for s in sources):
raise ValueError(f"{path}: donor_kernel_sources.{table} must be a list of non-empty strings")

validated: list[dict[str, str]] = []
for i, entry in enumerate(entries):
if not isinstance(entry, dict):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

schema_version: 1
reuse: []
# PR #219 found eager FP8-block timing included host launch gaps.
# Keep the original table for historical primary queries, but do not reuse
# DeepGemmFp8BlockScaledMMKernel or CutlassFp8BlockScaledMMKernel rows.
# These three kernels cover all remaining BF16, FP8 and NVFP4 rows.
donor_kernel_sources:
gemm_perf:
- torch.nn.functional.linear
- CutlassFP8ScaledMMLinearKernel
- FlashInferCuteDslNvFp4LinearKernel
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

schema_version: 2
provenance: local
runtime:
framework: vllm
version: 0.25.0
image: vllm/vllm-openai
image_digest: sha256:e1c1ff1af9a15921bfa11d1d95047258c1797392cdbfa296e7639da446b23f97
tables:
context_attention_perf:
rows: 52836
status: complete
collections:
- collector_ref: cbaf51b64fa460e5ec6146bde407a4c64958212d
collector_hash: sha256:262799b47ef42d0dae5ced92845517d20da265daea5c58dee5813f84c7fe5ec0
case_plan_hash: sha256:04acb1ef5df69580c3028de4dbe34f5e7697450ce783366632247395a3ed3507
collected_at: '2026-09-16'
rows: 52836
status: complete
generation_attention_perf:
rows: 65408
status: complete
collections:
- collector_ref: cbaf51b64fa460e5ec6146bde407a4c64958212d
collector_hash: sha256:262799b47ef42d0dae5ced92845517d20da265daea5c58dee5813f84c7fe5ec0
case_plan_hash: sha256:12df4833c99374841693e9bec6da73b3e7a8300acb5ca88e92c5c43d4bb24cdc
collected_at: '2026-09-16'
rows: 65408
status: complete
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

schema_version: 2
provenance: local
runtime:
framework: vllm
version: 0.25.0
image: vllm/vllm-openai
image_digest: sha256:e1c1ff1af9a15921bfa11d1d95047258c1797392cdbfa296e7639da446b23f97
tables:
encoder_attention_perf:
rows: 7679
status: complete
collections:
- collector_ref: cbaf51b64fa460e5ec6146bde407a4c64958212d
collector_hash: sha256:b65cba616f0be2a3d04cc4192ee7e46b096784accdf6e1bb5e193987894a8830
case_plan_hash: sha256:8a4f0e45a56a4b73354b445a9b3bccde722835cb6c6c133991182ba092eb1296
collected_at: '2026-09-16'
rows: 7679
status: complete
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

schema_version: 1
reuse: []
# PR #219 found eager FP8-block timing included host launch gaps.
# Keep the original table for historical primary queries, but do not reuse
# DeepGemmFp8BlockScaledMMKernel or CutlassFp8BlockScaledMMKernel rows.
# These three kernels cover all remaining BF16, FP8 and NVFP4 rows.
donor_kernel_sources:
gemm_perf:
- torch.nn.functional.linear
- CutlassFP8ScaledMMLinearKernel
- FlashInferCuteDslNvFp4LinearKernel
Loading
Loading