Documentation
¶
Overview ¶
Package blisschemas is the entry point: it composes field-level validation with version-scoped rule validation over a complete set of documents.
The two layers stay visible in the result. A Report separates field problems from rule problems, because the two need different responses: a field problem is a malformed document and always the author's to fix, where a rule problem may mean the document is right and the engine version is wrong, or that a rule needs updating for a release it has not seen.
Field validation runs first and rule validation only if it passes. A rule reading a malformed document produces findings that are artifacts of the malformation, and a reader cannot tell those from real ones.
Index ¶
- func LoadAcceptanceProfileSet(path string) (*acceptance.ProfileSet, error)
- func LoadCatalogWorkload(path string) (*workload.CatalogWorkload, error)
- func LoadChip(path string) (*hardware.Chip, error)
- func LoadCoefficientSet(path string) (*coefficient.Set, error)
- func LoadDeployment(path string) (*deployment.Deployment, error)
- func LoadEvaluationRun(path string) (*evaluation.Run, error)
- func LoadFabric(path string) (*hardware.Fabric, error)
- func LoadMeasuredRun(path string) (*measurement.MeasuredRun, error)
- func LoadMeasurementSources(path string) (*measurement.Registry, error)
- func LoadModelGraph(path string) (*model.Graph, error)
- func LoadModelIdentity(path string) (*model.Identity, error)
- func LoadRoutingProfileSet(path string) (*routing.ProfileSet, error)
- func LoadScenario(path string) (*scenario.Scenario, error)
- func LoadStorageDevices(path string) ([]*hardware.StorageDevice, error)
- func LoadWorkload(path string) (*workload.Shape, error)
- func ResolveReplay(catalogRoot string, r *workload.Replay) (*workload.Replay, error)
- type Bundle
- type Report
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadAcceptanceProfileSet ¶ added in v0.4.0
func LoadAcceptanceProfileSet(path string) (*acceptance.ProfileSet, error)
LoadAcceptanceProfileSet reads an acceptance-profile set from blis-registry's acceptance namespace. It does not validate; call Validate.
func LoadCatalogWorkload ¶ added in v0.4.0
func LoadCatalogWorkload(path string) (*workload.CatalogWorkload, error)
LoadCatalogWorkload reads one catalog workloads/<name>.yaml in either form: a traffic shape, or a replay workload when the file's top-level key is replay:. Both are named from the path stem, and both decode strictly. A replay file may carry the catalog's `_comment` keys at its top level, as a shape may.
func LoadChip ¶
LoadChip reads a chip descriptor from blis-catalog's hardware namespace. The file carries no name — identity is the filename — so the loader stamps Chip.Name from the path stem. The Chip type tags Name `yaml:"-"`, so the stamp is the field's only source: there is no in-file name to prefer, hence no `if Name == ""` guard, and an in-file `name` is rejected under strict decode (#27).
func LoadCoefficientSet ¶
func LoadCoefficientSet(path string) (*coefficient.Set, error)
LoadCoefficientSet reads a coefficient set from blis-registry.
func LoadDeployment ¶
func LoadDeployment(path string) (*deployment.Deployment, error)
LoadDeployment reads a deployment document — the tunable configuration applied to a scenario. It does not validate; call Validate.
func LoadEvaluationRun ¶
func LoadEvaluationRun(path string) (*evaluation.Run, error)
LoadEvaluationRun reads a measured run.
func LoadFabric ¶
LoadFabric reads a fabric descriptor from blis-catalog's networks namespace, naming it from the filename as LoadChip does: the stamp is Fabric.Name's only source, and an in-file `name` is a rejected unknown field (#27).
func LoadMeasuredRun ¶ added in v0.4.0
func LoadMeasuredRun(path string) (*measurement.MeasuredRun, error)
LoadMeasuredRun reads a measured run from blis-catalog's measurements/<source>/. It does not validate; call ValidateWithSources with the registry beside it.
func LoadMeasurementSources ¶ added in v0.4.0
func LoadMeasurementSources(path string) (*measurement.Registry, error)
LoadMeasurementSources reads the licence registry, blis-catalog's measurements/sources.yaml.
func LoadModelGraph ¶
LoadModelGraph reads a derived model graph.
func LoadModelIdentity ¶
LoadModelIdentity reads a model entry's identity manifest, blis-catalog's models/<name>/model.yaml: the name the entry claims and the provenance of the vendor config beside it. Unlike a chip, a fabric or a workload, this file carries its name IN the document — the catalog requires that name to match the directory — so the loader does not stamp it; the caller checks it against the directory, as it does for a graph.
func LoadRoutingProfileSet ¶ added in v0.4.0
func LoadRoutingProfileSet(path string) (*routing.ProfileSet, error)
LoadRoutingProfileSet reads a routing-profile set from blis-registry's routing namespace. It does not validate; call Validate.
func LoadScenario ¶
LoadScenario reads a scenario document. It does not validate; call Validate.
func LoadStorageDevices ¶
func LoadStorageDevices(path string) ([]*hardware.StorageDevice, error)
LoadStorageDevices reads the offload-tier classes from blis-catalog's devices namespace.
The file is a mapping of tier name to device facts rather than a list, because a tier is referred to by name from a deployment's offload block. So this loader is not a plain decodeStrict: it walks the mapping and stamps each device's Name from its key, which is the only place that key survives into the loaded value.
Sorted by name on return, so two loads of one file yield the same order and a caller comparing kernels built from it is comparing configuration rather than map iteration.
func LoadWorkload ¶
LoadWorkload reads a traffic shape from blis-catalog's workloads namespace. The file carries no name — identity is the filename — so the loader stamps Shape.Name from the path stem. The Shape type tags Name `yaml:"-"`, so the stamp is the field's only source: there is no in-file name to prefer, hence no `if Name == ""` guard, and an in-file `name` is rejected under strict decode. Chip and Fabric now follow this same rule (#27), so the three by-filename entities are single-sourced identically.
A replay workload (a file whose top-level key is replay:) is not a shape; it is refused here with a pointer to LoadCatalogWorkload, which reads either form.
func ResolveReplay ¶ added in v0.4.0
ResolveReplay returns the inline replay a binding's replay arm describes: an inline replay as it is, or a reference merged with the catalog replay workload it names, read from <catalogRoot>/workloads/<name>.yaml. It refuses a missing entry, an entry that is a shape, and a merge that is not a valid replay.
Types ¶
type Bundle ¶
type Bundle struct {
Scenario *scenario.Scenario
Deployment *deployment.Deployment
Model *model.Graph
Chip *hardware.Chip
Fabric *hardware.Fabric
Devices []*hardware.StorageDevice
Coefficients []*coefficient.Set
// AcceptanceProfiles are registry acceptance-profile sets, validated field by field.
AcceptanceProfiles []*acceptance.ProfileSet
// RoutingProfiles are registry routing-profile sets, validated field by field.
RoutingProfiles []*routing.ProfileSet
Workload *workload.Shape
// ReplayWorkload is a catalog replay workload, validated field by field.
ReplayWorkload *workload.CatalogReplay
Evaluation *evaluation.Run
}
Bundle is a complete set of documents describing one run. Optional members are nil when a caller is validating a subset: a catalog contributor checks a chip alone, where a CI job checking a run supplies everything. The Scenario fixes the immutable problem and the Deployment the mutable configuration against it; validating both together is what checks that a deployment fits its cluster.
type Report ¶
type Report struct {
// Field holds structural problems: malformed documents, unrecognized vocabulary,
// arithmetic that does not close. These are version-independent.
Field *validate.Problems
// Rule holds version-scoped problems, each attributed to a named rule.
Rule *validate.Problems
// RulesApplied is the engine version whose pack ran, empty if none did.
RulesApplied string
}
Report is the outcome of validating a bundle, with the two layers kept apart.
func Validate ¶
Validate checks a bundle: every present document field-by-field, then the version-scoped rules if the field layer passed.
Example ¶
ExampleValidate validates a scenario and a deployment together with the catalog documents they name.
package main
import (
"fmt"
blisschemas "github.com/inference-sim/blis-schemas"
)
func must[T any](v T, err error) T {
if err != nil {
panic(err)
}
return v
}
func main() {
// --8<-- [start:validate]
s := must(blisschemas.LoadScenario("docs/examples/scenario.yaml"))
d := must(blisschemas.LoadDeployment("docs/examples/deployment.yaml"))
g := must(blisschemas.LoadModelGraph("testdata/models/llama-3.1-8b-instruct/graph.yaml"))
c := must(blisschemas.LoadChip("testdata/hardware/h100.yaml"))
rep := blisschemas.Validate(blisschemas.Bundle{
Scenario: s, Deployment: d, Model: g, Chip: c,
})
for _, p := range rep.Problems() {
fmt.Println(p)
}
fmt.Println("ok:", rep.OK(), "rules applied:", rep.RulesApplied)
// --8<-- [end:validate]
}
Output: ok: true rules applied: 0.29.0
Example (Problems) ¶
ExampleValidate_problems shows what a failing bundle reports: every problem at once, each at the path of the field that is wrong.
package main
import (
"fmt"
blisschemas "github.com/inference-sim/blis-schemas"
)
func must[T any](v T, err error) T {
if err != nil {
panic(err)
}
return v
}
func main() {
s := must(blisschemas.LoadScenario("docs/examples/scenario.yaml"))
d := must(blisschemas.LoadDeployment("docs/examples/deployment.yaml"))
// --8<-- [start:problems]
pool := &d.Pools[0]
pool.Parallel.TP = 8 // 8 x 4 data-parallel ranks needs 32 GPUs
pool.Parallel.DCP = 3 // does not divide tp
pool.Engine.GPUMemoryUtilization = 1.5
rep := blisschemas.Validate(blisschemas.Bundle{Scenario: s, Deployment: d})
for _, p := range rep.Problems() {
fmt.Println(p)
}
// --8<-- [end:problems]
}
Output: error: deployment.pools[0].engine.gpu_memory_utilization: must lie in [0, 1] (0 means unset), got 1.5 error: deployment.pools[0].parallel: needs 32 GPUs (pp 1 x tp 8 x pcp 1 x dp 4, one per rank) but the pool's 1 node(s) of 8 GPUs provide 8 error: deployment.pools[0].parallel.dcp: decode-context parallelism reuses the tensor-parallel ranks when prefill-context parallelism is off, so tp 8 must be divisible by dcp 3
Example (Rules) ¶
ExampleValidate_rules shows a rule problem: the documents are well formed, but the engine version they name would refuse them.
package main
import (
"fmt"
blisschemas "github.com/inference-sim/blis-schemas"
)
func must[T any](v T, err error) T {
if err != nil {
panic(err)
}
return v
}
func main() {
s := must(blisschemas.LoadScenario("docs/examples/scenario.yaml"))
d := must(blisschemas.LoadDeployment("docs/examples/deployment.yaml"))
// --8<-- [start:rules]
d.Pools[0].Engine.CacheDType = "fp8_e4m3fn" // not a name vLLM 0.29.0 accepts
rep := blisschemas.Validate(blisschemas.Bundle{Scenario: s, Deployment: d})
fmt.Println("field layer ok:", rep.Field.OK())
for _, p := range rep.Rule.All() {
fmt.Println(p)
}
// --8<-- [end:rules]
}
Output: field layer ok: true error [enum-values-known]: : pools[0].engine.cache_dtype: "fp8_e4m3fn" is not accepted by engine 0.29.0
func ValidateAgainstCatalog ¶ added in v0.2.0
ValidateAgainstCatalog resolves every by-name reference a bundle's scenario makes against a catalog and registry on disk. It is separate from Validate on purpose: Validate is pure, and this repository deliberately does not vendor the catalog, so a caller without one checked out gets the pure checks and one with a catalog gets the references resolved too. The README's "two layers" split rests on that separation — keeping the shapes apart from the contents is what lets either side be validated in CI without the other being present — so resolution lives behind its own entry point rather than inside Validate.
It checks presence, not validity: that model names a directory the catalog has, that hardware, fabric and a workload shape name files it has, and that every storage tier, coefficient set and acceptance-profile set a scenario names exists. A replay arm that references a catalog replay workload is loaded and merged with its run choices (ResolveReplay), since a reference that resolves to an invalid replay is a miss too. The Trace arm and an inline Replay are excluded on purpose — they reference external captures by path or repository, not catalog identities. Validating the resolved documents is Validate's job, reached by loading them into a Bundle; this answers the prior question of whether the names resolve at all, which nothing else does — `hardware: nvidia-h200` validates clean today and fails later, elsewhere, as a missing file rather than an invalid scenario.
Every failure names the path it looked for and enumerates what the catalog actually has, so the error teaches the naming convention in one turn rather than leaving a generator to guess: `hardware: nvidia-h200` → "looked for hardware/nvidia-h200.yaml; the catalog has [a100-80 a100-sxm b200 h100 h200 ...]".
A nil scenario resolves nothing and is reported as such rather than passing silently: a bundle with no scenario names no references, so there is nothing to resolve, but a caller that meant to pass one should not read an empty green as success. An empty catalogRoot or registryRoot is only an error when a reference of the corresponding kind is actually made.
Problems are recorded under dotted paths below "references." — references.hardware, references.coefficients[1] — matching how spec/ validators report, so a reader of a mixed report sees resolution findings in the same shape as field findings.
Example ¶
ExampleValidateAgainstCatalog resolves a scenario's by-name references against a catalog checkout and a registry checkout.
package main
import (
"fmt"
"os"
"path/filepath"
blisschemas "github.com/inference-sim/blis-schemas"
)
func must[T any](v T, err error) T {
if err != nil {
panic(err)
}
return v
}
func main() {
// A stand-in registry: resolution checks only that each named set's file exists.
registry := must(os.MkdirTemp("", "registry"))
defer os.RemoveAll(registry)
must(0, os.MkdirAll(filepath.Join(registry, "coefficients"), 0o755))
for _, name := range []string{"cost-model-primitives", "cost-model-collectives",
"cost-model-host-overheads", "cost-model-attention", "cost-model-recurrent"} {
must(0, os.WriteFile(filepath.Join(registry, "coefficients", name+".yaml"), nil, 0o644))
}
// --8<-- [start:resolve]
s := must(blisschemas.LoadScenario("docs/examples/scenario.yaml"))
s.Cluster.Hardware = "nvidia-h100" // the catalog calls it h100
rep := blisschemas.ValidateAgainstCatalog(
blisschemas.Bundle{Scenario: s}, "testdata", registry)
for _, p := range rep.Problems() {
fmt.Println(p)
}
// --8<-- [end:resolve]
}
Output: error: references.hardware: "nvidia-h100": looked for hardware/nvidia-h100.yaml; the catalog has [a100-80 a100-sxm b200 b300 gb200-nvl72 h100 h200 l40s]
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
validate-catalog
command
Command validate-catalog loads every committed artifact in a blis-catalog checkout and validates it against the schema.
|
Command validate-catalog loads every committed artifact in a blis-catalog checkout and validates it against the schema. |
|
validate-measurements
command
Command validate-measurements checks a measurements directory: the licence registry in sources.yaml, and every measured run under <license_ref>/<name>.yaml against it.
|
Command validate-measurements checks a measurements directory: the licence registry in sources.yaml, and every measured run under <license_ref>/<name>.yaml against it. |
|
validate-registry
command
Command validate-registry loads every committed coefficient set in a blis-registry checkout, and every acceptance-profile set under acceptance/ when the registry hosts any, and validates each against the schema.
|
Command validate-registry loads every committed coefficient set in a blis-registry checkout, and every acceptance-profile set under acceptance/ when the registry hosts any, and validates each against the schema. |
|
internal
|
|
|
docgen
command
Command docgen writes the parts of the documentation that are facts about the code: the members of every closed vocabulary, and each registered rules pack's rules and accepted values.
|
Command docgen writes the parts of the documentation that are facts about the code: the members of every closed vocabulary, and each registered rules pack's rules and accepted values. |
|
measurements
Package measurements checks a measurements directory as a whole: the licence registry in sources.yaml and every run under <license_ref>/, each against the registry.
|
Package measurements checks a measurements directory as a whole: the licence registry in sources.yaml and every run under <license_ref>/, each against the registry. |
|
registry
Package registry locates the committed coefficient-set files in a blis-registry checkout, with one discovery predicate shared by every blis-schemas surface that walks the registry — the validate-registry command and the committed-data test — so they cannot drift from each other or from the registry's own gate.
|
Package registry locates the committed coefficient-set files in a blis-registry checkout, with one discovery predicate shared by every blis-schemas surface that walks the registry — the validate-registry command and the committed-data test — so they cannot drift from each other or from the registry's own gate. |
|
validate
Package validate holds the reporting types every validator shares: a located, accumulating problem list rather than a first-error return.
|
Package validate holds the reporting types every validator shares: a located, accumulating problem list rather than a first-error return. |
|
Package kernel is the interface a cost model implements and a discrete-event simulator calls.
|
Package kernel is the interface a cost model implements and a discrete-event simulator calls. |
|
kerneltest
Package kerneltest holds checks of the kernel.Kernel contract that any implementation can run against itself, in the way testing/fstest checks an fs.FS.
|
Package kerneltest holds checks of the kernel.Kernel contract that any implementation can run against itself, in the way testing/fstest checks an fs.FS. |
|
Package rules holds validation that depends on an engine version.
|
Package rules holds validation that depends on an engine version. |
|
v0_29
Package v0_29 is the rules pack for vLLM 0.29.x.
|
Package v0_29 is the rules pack for vLLM 0.29.x. |
|
v0_31
Package v0_31 is the rules pack for vLLM 0.31.0 (tag v0.31.0, commit db9527a468), the release blis-latency-kernel encodes.
|
Package v0_31 is the rules pack for vLLM 0.31.0 (tag v0.31.0, commit db9527a468), the release blis-latency-kernel encodes. |
|
spec
|
|
|
acceptance
Package acceptance describes how far speculative decoding advances a request per verification step: a profile set of measured acceptance lengths hosted in blis-registry, the inline values a workload, a scenario or a command line may state instead, and the resolution that picks one of them for a run (blis-schemas#65).
|
Package acceptance describes how far speculative decoding advances a request per verification step: a profile set of measured acceptance lengths hosted in blis-registry, the inline values a workload, a scenario or a command line may state instead, and the resolution that picks one of them for a run (blis-schemas#65). |
|
coefficient
Package coefficient defines a coefficient set: the learned numbers a cost estimate depends on, each recording where it came from and where it holds.
|
Package coefficient defines a coefficient set: the learned numbers a cost estimate depends on, each recording where it came from and where it holds. |
|
deployment
Package deployment describes the mutable configuration a user — or an optimizer sweeping a configuration space — chooses against a fixed Scenario: how a model is laid out across the available hardware (pools, each a role at a parallelism layout with its own engine settings), the KV offload hierarchy below HBM, and prefill-to-decode KV transfer.
|
Package deployment describes the mutable configuration a user — or an optimizer sweeping a configuration space — chooses against a fixed Scenario: how a model is laid out across the available hardware (pools, each a role at a parallelism layout with its own engine settings), the KV offload hierarchy below HBM, and prefill-to-decode KV transfer. |
|
evaluation
Package evaluation describes a measured serving run: the record a prediction is compared against.
|
Package evaluation describes a measured serving run: the record a prediction is compared against. |
|
hardware
Package hardware defines the three catalog entities that describe physical resources: a chip, an inter-node fabric, and a storage device class.
|
Package hardware defines the three catalog entities that describe physical resources: a chip, an inter-node fabric, and a storage device class. |
|
measurement
Package measurement describes a measured serving run as a validation case: what was measured, where every input came from, how each metric was defined, and how far the configuration BLIS would simulate is from the one that ran.
|
Package measurement describes a measured serving run as a validation case: what was measured, where every input came from, how each metric was defined, and how far the configuration BLIS would simulate is from the one that ran. |
|
model
Package model defines a model as a directed acyclic graph of cost primitives.
|
Package model defines a model as a directed acyclic graph of cost primitives. |
|
router
Package router describes the request router in front of a deployment, so that a measured run records what chose each request's replica.
|
Package router describes the request router in front of a deployment, so that a measured run records what chose each request's replica. |
|
routing
Package routing describes how unevenly a mixture-of-experts router loads the ranks of an expert-parallel group: a profile set of measured imbalance curves hosted in blis-registry, the inline value a workload, a scenario or a command line may state instead, and the resolution that picks one of them for a run.
|
Package routing describes how unevenly a mixture-of-experts router loads the ranks of an expert-parallel group: a profile set of measured imbalance curves hosted in blis-registry, the inline value a workload, a scenario or a command line may state instead, and the resolution that picks one of them for a run. |
|
scenario
Package scenario describes the immutable problem a user is handed: which model, on which available hardware, measured against which workload (a distributional shape or a concrete captured trace), and fitted against which coefficient and engine-version references.
|
Package scenario describes the immutable problem a user is handed: which model, on which available hardware, measured against which workload (a distributional shape or a concrete captured trace), and fitted against which coefficient and engine-version references. |
|
workload
Package workload describes the traffic a deployment is measured against.
|
Package workload describes the traffic a deployment is measured against. |
|
Package vocab holds the closed vocabularies every schema draws on: units, evidence methods, scope keys, provenance.
|
Package vocab holds the closed vocabularies every schema draws on: units, evidence methods, scope keys, provenance. |