Skip to content
Merged
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
6 changes: 6 additions & 0 deletions docs/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -377,3 +377,9 @@

[ ] Guard or stride the 65,535 * 1024 (~64 MiB/uint8 row) gridDim.y ceiling
in ignition/components/state.py row kernels.

[ ] Measure the unresolved kernel-argument diagnostic on a four-GPU DeepSeek
V4.1 export (issue #266) and an eight-GPU W4A8 MoE export, recording
per-rank aligned occurrence and distinct-address counts. Close when both
exports have run on four-GPU and eight-GPU hardware and the per-rank
counts and printed per-kernel examples have been reviewed.
5 changes: 4 additions & 1 deletion docs/preparation-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ before the session's capture guard forbids further kernel resolution.
When `capture_forwards` receives `warmup_storage`, the preparation's
`CoreStorage` (`ignition/preparation/core_storage.py`), eager warmups allocate
from its transient pools and release them before capture, so
their workspaces do not coexist with retained graph intermediates. Ranks
their workspaces do not coexist with retained graph intermediates, while
cuBLAS warmup workspaces are seeded into `CoreStorage.warmup_pool()` so they
stay outside transient and graph pools while remaining inside declared core
mappings. Ranks
synchronize before each warmup and each capture. Retain compiled kernel owners
until native replay has drained. Compiled forwards retain Inductor memory-pool
planning, storage reuse, and default peak-memory operation reordering; callers
Expand Down
10 changes: 8 additions & 2 deletions docs/runtime-core-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ conversions, inline assembly, or opaque calls retain conservative argument
scanning. Untyped structs, tensor maps, globals, and integer/byte storage without
a numeric role are scanned for address candidates. This can retain false
positives and retains complete backing segments, including unused bytes within
a reachable segment. The preparation metadata does not enter the serving index.
a reachable segment. Argument-relative 8-byte-aligned kernel-argument values
inside the recorded address envelope that resolve to no active recorded
allocation (a gap between allocations or an inactive range) are reported on
stderr per rank as a non-blocking diagnostic without retaining inactive storage.
The preparation metadata does not enter the serving index.
Omitted arena allocations keep their virtual ranges reserved and physically unmapped,
so an unexpected access faults instead of reaching another allocation.

Expand Down Expand Up @@ -356,7 +360,9 @@ compresses, hashes, and syncs each rank's archive before publication.

Native stderr rows omit the Flare banner. Rank-zero capture reports storage
clearing, graph inspection and serialization, module/global capture, storage scans,
weight materialization, and frontend assets. Coordinators report export peer waits,
weight materialization, and frontend assets. Each rank also writes a bounded
stderr summary when kernel-argument reachability scanning finds aligned
unresolved address candidates. Coordinators report export peer waits,
rank transfers, and preparation-resource release before publication.
Publication reports payload assembly, validation, frontend verification, each rank's
executable compression and installation, each rank's data verification and
Expand Down
4 changes: 3 additions & 1 deletion heliopause/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ fn collect_sources(directory: &Path, files: &mut Vec<PathBuf>) {
&& path
.extension()
.and_then(|value| value.to_str())
.is_some_and(|value| matches!(value, "py" | "rs" | "c" | "cu" | "cuh" | "h"))
.is_some_and(|value| {
matches!(value, "py" | "rs" | "c" | "cpp" | "cu" | "cuh" | "h" | "hpp")
})
{
println!("cargo:rerun-if-changed={}", path.display());
files.push(path);
Expand Down
16 changes: 12 additions & 4 deletions heliopause/src/export/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,15 +1146,23 @@ mod stage_tests {
}
}

#[pyfunction(signature = (roots, *, excluded_directories = None))]
#[pyfunction(signature = (roots, *, excluded_directories = None, excluded_files = None))]
fn export_source_identity(
py: Python<'_>,
roots: Vec<std::path::PathBuf>,
excluded_directories: Option<Vec<std::path::PathBuf>>,
excluded_files: Option<Vec<std::path::PathBuf>>,
) -> PyResult<String> {
py.detach(|| match excluded_directories {
Some(excluded) => super::source_identity::source_identity_excluding(&roots, &excluded),
None => super::source_identity::source_identity(&roots),
py.detach(|| {
let mut excluded = excluded_directories.unwrap_or_default();
if let Some(files) = excluded_files {
excluded.extend(files);
}
if excluded.is_empty() {
super::source_identity::source_identity(&roots)
} else {
super::source_identity::source_identity_excluding(&roots, &excluded)
}
})
.map_err(|e| PyRuntimeError::new_err(e.to_string()))
}
Expand Down
5 changes: 4 additions & 1 deletion heliopause/src/export/capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3379,7 +3379,7 @@ pub(crate) fn capture_rank(
&indices,
&request.events,
)?;
reach.graph(&nodes, &kernels)?;
reach.graph(&graph.name, &nodes, &kernels)?;
let file = format!("graph-{index}.bin");
let path = stage.path.join(&file);
let mut writer = BufWriter::new(File::create(&path)?);
Expand Down Expand Up @@ -3414,6 +3414,9 @@ pub(crate) fn capture_rank(
"{} graphs, {graph_bytes} bytes",
request.graphs.len()
));
for line in reach.unresolved_report(&output.index.ranks[0].functions) {
eprintln!("export: rank {}: {line}", request.rank);
}
let module_phase = progress.phase("Capture compiled modules and globals", None);
let mut module_bytes = 0u64;
let mut downloader = Downloader::new(&cuda)?;
Expand Down
Loading
Loading