S-exp GPU
All pages
Docs · ReferenceMarkdown

Diagnostic codes

Every diagnostic has a code, a primary span in a file you own, the expected and actual facts, and a fix when one is known; see check. W-* codes are warnings and never stop a compilation. sexpgpu check <file> --json gives the same as an array.

Reading and evaluating

codewhat it meansusual fix
E-READ-001end of input inside a form or a stringclose the bracket or the quote
E-READ-002an unexpected ) or ]remove it, or open the form it closes
E-READ-003a token that is not a number, keyword or symbol0.5 not .5; : plus a name for a keyword
E-EVAL-001the program called (error ...)read the message
E-EVAL-002an (assert ...) failedread the message
E-EVAL-003a name is not bound; a knob used before its defknobs lands herethe fix names the module that defines it, or the nearest name
E-EVAL-004calling something that is not a functioncheck the head of the call
E-EVAL-005a malformed special form, lambda list, or a binding of reserved syntaxuse the documented shape; see special forms
E-EVAL-006an argument of the wrong type, a bad destructuring, a bad dtype keywordcheck the operand
E-EVAL-007integer overflow or division by zero
E-EVAL-010a keyword argument that is not a keyword, unknown, or has no valuethe fix lists the accepted keywords
E-EVAL-011the wrong number of arguments
E-EVAL-030a file requires itselfmove the shared definitions into a third file
E-EVAL-031a required file cannot be readpaths are relative to the file holding the require
E-EVAL-032a require path is neither relative nor a package./name.sx, or sexpgpu/<module>
E-EVAL-033no such standard modulethe fix lists the ones that exist
E-EVAL-034a require names nothing or is in a local scopelist names, at module top level
E-EVAL-035a require names what the file does not definethe fix is the nearest name it does
E-EVAL-036a name bound twice in one file, by two imports or an import and a definitionrename, or import once
E-EVAL-040recursion deeper than 256 callsno tail calls; check the base case, or use repeat/reduce
E-EVAL-041compile-time work budget exceeded or invalidraise SEXPGPU_EVAL_LIMIT for finite generators

Tensors and staging

codewhat it meansusual fix
E-DIM-001shapes do not fitthe note names both operands as you wrote them
E-DIM-002dtypes differ, or :x is not a dtypedtypes are :f32 :bf16 :i32 :i64 :bool
E-DIM-003a tensor was expected
E-FLOW-001if on a tensorselect elementwise with (where test then else)
E-FLOW-002a tensor from another graphrecompute it here
E-FLOW-003a tensor operation with no graph being tracedtensors exist in prepare, a model, objective, evaluate, an optimizer body, an initializer or curriculum

Models and optimizers

codewhat it meansusual fix
E-PARAM-002defparam outside a modelparameters live inside defmodel
E-PARAM-003an initializer reads another valuean initializer is closed: shapes, constants, random nodes
E-PARAM-004a model body does not end in a functionreturn (lambda (x) ...) last
E-PARAM-005named on something that is not a model or a parameter
E-PARAM-006an unknown parameter option, or :numerics other than :highthe options are :tags and :numerics
W-PARAM-001a model is never bound to a namebind it with let, or named
E-OPT-001a selector matches no parametercheck paths with sexpgpu explain, or widen the glob
E-OPT-002a parameter is in more than one groupnarrow one selector with select-not
E-OPT-003a misplaced or duplicate state, or a state initializer that is not a zero constantreturn zeros, zeros-like or a zero full
E-OPT-004an optimizer body does not end in optimizer-update, or drops a statereturn every declared state exactly once
E-OPT-005a malformed select, group, :groups or :optimizer, or an inner optimizer with :groupsthe fix prints the shape
E-OBJ-001objective does not return one float scalarreduce the loss; report the parts with metric

The contract

codewhat it meansusual fix
E-CONTRACT-001a required top-level name is missingthe fix writes the form that defines it, (defrun :steps 300 :microbatches 4); see the run file
E-CONTRACT-002a contract name is the wrong kind of valuethe fix writes the form that defines it
E-CONTRACT-003an unknown keyword in a configuration form, or a bad :precisionthe fix lists the accepted ones
E-CONTRACT-004prepare did not return :inputs and :targets(list :inputs ... :targets ...)
E-CONTRACT-005the batch has no such fieldthe fix lists what the loader declares
E-CONTRACT-010counter outside preparecount where records are counted
E-CONTRACT-011metric in an optimizer bodya diagnostic, or compute it in objective or evaluate
E-CONTRACT-012a metric's metadata is over what Metrics accepts, runtime keys countedfewer or shorter keys
E-CONTRACT-013two defeval passes share a name
E-CONTRACT-014evaluate or curriculum with no defeval passdeclare a pass
E-CONTRACT-015a diagnostic without :reduce, with an unknown one, or two reducers for one nameone of :mean :min :max :sum
E-CONTRACT-016a diagnostics selection that names nothing the file definesthe fix lists the names
E-CONTRACT-017a metric inside a tap-gradient lambdareport the gradient with diagnostic

Knobs

codewhat it meansusual fix
E-KNOB-001a knob is declared twice
E-KNOB-003a variant or sweep sets something that is not a knobthe fix lists the knobs
E-KNOB-004the file declares no such variantthe fix lists the variants
E-KNOB-005the file declares no such knobthe fix lists the knobs
E-KNOB-006a duplicate variant, or one after defknobsdeclare variants once, before defknobs

Run time and tools

codewhat it meansusual fix
E-DP-001 .. E-DP-007several GPUs or nodes: configuration, rendezvous and resumesee devices
E-MEM-001the smallest memory plan does not fit on the device; the message names the number and the largest partfewer rows per microbatch (raise :microbatches), or a device with more memory; see devices
E-FMT-001the formatter refused its own outputa compiler bug; the file was left as it was
E-INTERNAL-001the lowered document failed validationa compiler bug, never the experiment's fault