HLO / mhlo / stablehlo Ingestion & the Stock-vs-Neuron Boundary
All addresses, symbol counts, and offsets on this page apply to
neuronx_cc2.24.5133.0+58f8de22 (cp310; cp310/11/12 are byte-identical — treat names, offsets, and constants as stable, virtual addresses as cp310-specific). The HLO pass corpus lives inneuronxcc/starfish/bin/hlo-opt(ELF, BuildID93dd8bd9bd4c697b, 229 MB, not stripped). The MLIR-side import/simplify passes live inneuronxcc/starfish/bin/hlo2penguin(BuildID4ea91b0c9770f006). Both binaries carry a full local symtab —nm -Cresolves 369,744 names onhlo-opt— so every claim below is anchored to a demangled symbol, a verbatim string, or a section offset.
Abstract
The Neuron front-half compiler is mostly upstream. hlo-opt and hlo2penguin statically link the whole of XLA, MHLO, StableHLO, and LLVM at the lts_20230802 Abseil snapshot; the great majority of the passes that run on a model are stock optimizers — AlgebraicSimplifier, HloDCE, BatchNormExpander, SpmdPartitioner, ShardingPropagation — that AWS did not write and does not maintain. Layered on top of that imported middle is a comparatively thin band of Neuron-authored passes that recognize Neuron custom-calls, coalesce collectives for the specific NeuronLink topology, reify control dependencies, and pattern-match the operators the device can lower. This page draws the line between the two so that every subsequent Part-4 page can state, for any pass it documents, whether that pass is or isn't Neuron's own code.
The line is not a judgment call — it is encoded in the C++ namespace mangling and the source-path strings baked into the binary. Neuron's HLO passes live in the xla::hilo:: namespace (2,042 demangled symbol-lines on hlo-opt); stock XLA passes live in the bare xla:: namespace (51,551 lines). Neuron's translation units are tagged hilo/hlo_passes/<Pass>.cc (76 distinct files); stock XLA's are tagged xla/hlo/transforms/<area>/<pass>.cc. Neuron's emitted ops are AwsNeuron* custom-calls; stock ops are the standard HloOpcode enum. Any one of these four markers classifies a pass; together they are redundant and mutually corroborating. A reimplementer who wants to know "did AWS write this, or is it free upstream code I can read in the open XLA tree?" applies the algorithm in §4 and gets a definite answer.
A caution governs every address on this page. hlo-opt is a 229 MB statically-linked executable whose load layout shifts the section offsets: for .text the virtual address exceeds the raw file offset by 0x201000, and for .rodata by 0x200000 (verified in §5). IDA's JSON sidecars report virtual addresses; a raw xxd/objdump --start-address against the on-disk file must subtract the per-section delta first. Get this wrong and a correct symbol lands in the wrong function — the single most common error when reading this binary.
For reimplementation, the contract this page establishes is:
- The four classification markers (
xla::hilo::namespace,Neuronclass prefix,hilo/hlo_passes/*.ccsource path,AwsNeuron*custom-call) and the precedence among them when they appear to disagree. - The stock-middle / Neuron-edge split: which broad pass families are imported wholesale (algebraic simplification, DCE, SPMD, sharding, expanders, the StableHLO↔HLO bridge) versus authored at AWS (collective combiners for NeuronLink, custom-call legalization, control-dep preservation, FS-pattern matching).
- The ingestion artifacts: that a
stochastic-convertop (and the whole stock opcode vocabulary) is recognized at the input boundary by the linked HLO/StableHLO parser even when there is no device lowering for it, and what that means for classifying a pass that touches such an op. - The
.text/.rodataoffset deltas, so addresses cited from the IDA JSON resolve to the right bytes on disk.
| HLO pass binary | neuronxcc/starfish/bin/hlo-opt — BuildID 93dd8bd9bd4c697b, not stripped |
| MLIR import/emit binary | neuronxcc/starfish/bin/hlo2penguin — BuildID 4ea91b0c9770f006 |
| Neuron namespace | xla::hilo:: — 2,042 symbol-lines (nm -C | rg -c 'xla::hilo::') |
| Neuron class-prefix subset | xla::hilo::Neuron* — 637 lines, ≥28 distinct classes |
| Stock XLA namespace | bare xla:: — 51,551 lines; xla::spmd:: (1,218), mlir::mhlo:: (11,194), mlir::stablehlo:: (12,736) |
| Neuron source-path marker | hilo/hlo_passes/*.cc — 76 distinct files; also hilo/tools/ |
| Stock source-path marker | xla/hlo/transforms/*.cc, xla/service/*.cc |
| Neuron emitted-op marker | AwsNeuron* custom-call targets (AwsNeuronControlDep, AwsNeuronGelu, …) |
| Pass registry (Neuron) | xla::hilo::RegisterHloPass @ 0x1ebc3f0; GetHloPassRegistry @ 0x1ebc570; hloPassRegistry (BSS) @ 0x9a38ee0 |
| Upstream snapshot pin | Abseil lts_20230802 (visible in every stock symbol's flat_hash_set type) |
.text VMA − fileoff | 0x201000 (VMA 0x1e6e960, fileoff 0x1c6d960) |
.rodata VMA − fileoff | 0x200000 (VMA 0x20c940, fileoff 0xc940) |
1. Why the boundary matters
Treat the two front-half binaries as XLA distributions with a Neuron delta. hlo-opt is the XLA HLO optimizer compiled into a tool; hlo2penguin is the same plus an MLIR (MHLO/StableHLO) import path and a Python-"Penguin"-IR emitter (4.32). Everything XLA ships — the HLO opcode enum, the literal evaluator, the shape verifier, the algebraic simplifier, the SPMD partitioner, the StableHLO dialect and its bridge to HLO — is inside these binaries, statically linked. Reverse-engineering the whole of either binary would mostly re-document open-source XLA. The interesting, closed, Neuron-specific behavior is the delta, and the delta is small relative to the imported mass: 2,042 xla::hilo:: lines against 51,551 bare-xla:: lines is roughly a 1-in-25 ratio of Neuron-authored to stock symbol surface.
The practical consequence for the wiki: a Part-4 page documenting NeuronAllReduceCombiner is documenting genuinely closed AWS code (no open reference exists). A page documenting AlgebraicSimplifier or SpmdPartitioner is documenting stock XLA that happens to be linked in — the algorithm is in the public XLA tree, and the page's job is only to confirm it is present, identify the version pin, and note any Neuron-specific scheduling of it. The two demand different treatment, and conflating them produces two errors: crediting AWS with upstream work, or burying a genuine Neuron innovation under "it's just XLA." The marker test below removes the guesswork.
NOTE — "Neuron-authored" here means resides in the
xla::hilo::namespace /hilo/source tree — i.e. AWS's own first-party compiler code, distinct from the upstream XLA they vendored. It does not mean "novel algorithm." Somexla::hilo::passes are thin Neuron wrappers that call straight into a stockxla::helper (the combiners reusexla::AllReduceCombinerkey logic). The namespace tells you who owns the translation unit, which is exactly the provenance question Part 4 must answer; whether the contained algorithm is original is a separate, per-pass judgment.
2. The imported middle (stock XLA / MHLO / StableHLO)
What is linked, and how to recognize it
The stock corpus occupies the bare xla::, mlir::mhlo::, mlir::stablehlo::, and xla::spmd:: namespaces. It is recognizable three ways, any of which suffices:
- Bare
xla::<Pass>mangling — nohiloinfix.nm -C hlo-opt | rg '(^| )xla::AlgebraicSimplifier'returns 477 lines (the count is dominated byAlgebraicSimplifierVisitortemplate instantiations); the same query withxla::hilo::AlgebraicSimplifierreturns 0. The pass is inxla::, notxla::hilo::. This holds for every stock pass sampled (see table). - Stock source path — the
Run/namebodies are taggedxla/hlo/transforms/<area>/<pass>.ccorxla/service/<pass>.cc, e.g.xla/hlo/transforms/expanders/stochastic_convert_decomposer.cc,xla/hlo/transforms/expanders/qr_expander.cc. Contrast the Neuron markerhilo/hlo_passes/*.cc(§3). - Abseil
lts_20230802type tag — every stockRun(HloModule*, const flat_hash_set<…>&)signature carriesabsl::lts_20230802::flat_hash_set<…>in its mangling (confirmed onxla::StochasticConvertDecomposer::Run@0x27629b0). That LTS tag is the upstream snapshot the whole tree was vendored from; it is the single most reliable "this is imported XLA" fingerprint because it brands the type system, not the symbol name.
Representative stock families (CONFIRMED present)
| Stock pass / family | Namespace | Symbol-line count (nm -C) | Notes |
|---|---|---|---|
AlgebraicSimplifier | xla:: | 477 | the canonical peephole simplifier (count dominated by AlgebraicSimplifierVisitor instantiations) |
HloDCE | xla:: | 28 | dead-code elimination |
HloCSE | xla:: | 20 | common-subexpression elimination |
TupleSimplifier | xla:: | 15 | stock tuple cleanup (distinct from the Neuron MLIR NeuronControlDepTupleSimplifier, §3) |
WhileLoopSimplifier | xla:: | 16 | loop cleanup |
BatchNormExpander | xla:: | 14 | drives --expand-batch-norm-training |
ZeroSizedHloElimination | xla:: | 10 | empty-tensor removal |
FlattenCallGraph | xla:: | 17 | call-graph flattening |
StochasticConvertDecomposer | xla:: | 10 | the stochastic-convert expander (§6) |
ShardingPropagation | xla:: | 75 | SPMD sharding inference |
SpmdPartitioner | xla::spmd:: | (family) | stock SPMD partitioner; StatefulRngSpmdPartitioner also present |
GOTCHA — SPMD is stock, and this trips people because the driver exposes a
--spmdflag ("Run additional optimizations only applied to SPMD models", 4.1 / D-A01 §4). The flag is Neuron's; the partitioner it gates isxla::spmd::SpmdPartitioner/xla::spmd::StatefulRngSpmdPartitioner, pure upstream XLA (Part 13). A Neuron flag toggling a stock pass is the common shape — do not let a Neuron-named knob promote the pass it controls to "Neuron-authored." Classify the pass body's namespace, not the flag that schedules it.
The MHLO / StableHLO dialects and the bridge
hlo2penguin ingests both raw XLA HloModule protos and MLIR text in the MHLO or StableHLO dialects (D-A01 §3: parseHloProtoInput vs parseSourceFile + runStableHLOFrontendPipeline + ConvertStablehloToHlo). The dialects themselves are stock: mlir::mhlo:: (11,194 lines) and mlir::stablehlo:: (12,736 lines) are the open MHLO/StableHLO models, and the StableHLO→HLO bridge xla::ConvertStablehloToHlo plus the surrounding *StablehloToHlo*/*HloToMhlo* converters total 1,151 demangled symbol-lines — all bare-namespace upstream. The Neuron delta on the MLIR side is not the dialects but a small set of hilo::-namespaced MLIR passes that run after import (next section).
3. The Neuron edge (authored passes)
The four shapes of a Neuron-authored unit
Neuron's own code shows up in four mangling/string shapes. Internalize these — they are the whole classification basis:
xla::hilo::Neuron<Name>— the explicit Neuron-prefixed HLO passes. 637 symbol-lines; ≥28 distinct classes. Enumerated below.xla::hilo::<Name>without theNeuronprefix — also Neuron-authored. Thexla::hilo::namespace is the owner; theNeuronprefix is a naming convention applied to some but not all of its passes.PreserveControlDeps(D-B29) andConvertFSPatternsToCCarexla::hilo::with noNeuronprefix yet are unmistakably Neuron code (they emitAwsNeuron*custom-calls / match Neuron-customer patterns). This is the single most important subtlety on the page — the prefix is a hint, the namespace is the rule.hilo::<Name>(lowercasehilo, MLIR side, inhlo2penguin) — the MHLO/StableHLO-level Neuron passes:hilo::NeuronControlDepTupleSimplifier,hilo::isControlDep,hilo::runStableHLOFrontendPipeline. These do not appear inhlo-optat all (the HLO/MLIR split, §7).AwsNeuron*custom-call targets — the ops Neuron emits and recognizes. Not passes, but a corroborating signal: a pass that creates or matchesAwsNeuronControlDep,AwsNeuronGelu,AwsNeuronSoftmax, etc. is Neuron's by construction (stock XLA has no concept of these).
The xla::hilo::Neuron* class roster (CONFIRMED, 28 of 637 lines)
nm -C hlo-opt | rg -o 'xla::hilo::Neuron[A-Za-z0-9_]+' | sort -u:
NeuronAddBoundaryMarker NeuronLoopedEinsumReplacer
NeuronAllGatherCombiner NeuronLoopedEinsumTokenReplacer
NeuronAllReduceCombineKey NeuronMoveAllGatherWhileLoop
NeuronAllReduceCombiner NeuronMoveReduceScatterWhileLoop
NeuronCollectivePermuteToAllGather NeuronPreprocessKernelDuplicateRemover
NeuronCollectiveStreamIdInjector NeuronReduceScatterCombiner
NeuronCombiner NeuronRepeatedDusToConcat
NeuronDefaultMetadata NeuronRewriteAllGatherTripCount
NeuronDuplicateParameterAllGatherRemover NeuronSliceOfConcatOptimizer
NeuronDynamicSliceMover NeuronTokenCollectiveThreadingRepeated
NeuronDynamicUpdateSliceDynamicSliceSimplifier NeuronUniqueChannelIdEnforcer
NeuronFlipAllGatherDynamicSlice NeuronWhileLoopAllReduceCodeMotion
NeuronFlipReduceConvertAdd NeuronWhileLoopUnroller
NeuronHloInstCombine NeuronIntMatmulDowncast
The roster is dominated by collective rewriting (combiners, all-gather/reduce-scatter motion, channel-id enforcement, stream-id injection) — exactly the work a custom interconnect (NeuronLink) demands and that stock XLA's generic collective passes do not cover. The non-Neuron-prefixed xla::hilo:: cohort (sampled: AddMustAliases, ConvertFSPatternsToCC, DecomposeIntAllReduce, FlipAllGatherConvert, GroupedDusToConcat, IOLayoutNormalization, PreserveControlDeps) brings the total to 2,042 lines and is equally Neuron-owned.
The hilo/ source-path roster (CONFIRMED, 76 files)
strings -a hlo-opt | rg -o 'hilo/hlo_passes/[A-Za-z0-9_]+\.cc' | sort -u yields 76 distinct translation units (hilo/tools/ is the other hilo/ subtree). Sample:
hilo/hlo_passes/AddAlias.cc hilo/hlo_passes/FuseReduceScatter.cc
hilo/hlo_passes/BatchNormTrainingUpcast.cc hilo/hlo_passes/HiloConditionalToSelect.cc
hilo/hlo_passes/BoundaryMarkerRemoval.cc hilo/hlo_passes/HloPassManager.cc
hilo/hlo_passes/CollectiveTokenRemoval.cc hilo/hlo_passes/InjectNumericalErrors.cc
hilo/hlo_passes/ConvertCollectivesToCustomCall.cc hilo/hlo_passes/InlineWeights.cc
hilo/hlo_passes/ConvertFSPatternsToCC.cc hilo/hlo_passes/IOLayoutNormalization.cc
hilo/hlo_passes/DecomposeAttention.cc hilo/hlo_passes/LegalizeAwsNeuronArgMax.cc
hilo/hlo_passes/DecomposeCCOps.cc hilo/hlo_passes/PreserveControlDeps.cc
hilo/hlo_passes/EmitOffloadedDropout.cc … (76 total)
The hilo/hlo_passes/PreserveControlDeps.cc tag is the clinching cross-check on the "namespace, not prefix" rule from §3: PreserveControlDeps has no Neuron prefix, yet its source file lives in hilo/hlo_passes/, and D-B29 reads its setSourceLine 0x31(=49) directly off the rodata string hilo/hlo_passes/PreserveControlDeps.cc @ VMA 0x2b8088. Two independent markers — namespace and source path — agree.
The AwsNeuron* emitted-op roster (CONFIRMED)
strings -a hlo-opt | rg -o '\bAwsNeuron[A-Za-z]+' | sort -u (selection):
AwsNeuronArgMax AwsNeuronControlDep AwsNeuronGelu
AwsNeuronArgMin AwsNeuronDevicePrint AwsNeuronGeluBackward
AwsNeuronCollectiveMatmul AwsNeuronDropout AwsNeuronRmsNorm
AwsNeuronCustomNativeKernel AwsNeuronErf AwsNeuronSilu
AwsNeuronModuleMarkerStart/End AwsNeuronSoftmax/Backward AwsNeuronTopK
These are the custom_call_target strings Neuron passes plant into the HLO graph; AwsNeuronControlDep (target len 0x13=19) is the control-dep reification op (D-B29 §2.1). A pass that constructs one of these is Neuron's. (One string, AwsNeuronAllReduAwsNeuronReduceSfficient, is a rodata-adjacency artifact of two overlapping literals, not a real target — a reminder that raw strings can splice neighbors; trust the demangled symbol over the spliced string when they conflict.)
4. The classification algorithm
Given a candidate pass (by class name, by the Run/name symbol, or by the source-path string at its body), decide stock vs Neuron:
// Returns STOCK | NEURON | NEEDS_REVIEW for an hlo-opt / hlo2penguin pass.
// Inputs available from the not-stripped binary: demangled symbol (nm -C),
// the source-path .cc string at the pass body, the custom_call_target it emits.
classify(pass):
sym = demangled_symbol(pass.Run_or_name) // e.g. "xla::hilo::NeuronAllReduceCombiner::Run"
src = source_path_string(pass.body) // e.g. "hilo/hlo_passes/FuseReduceScatter.cc" or
// "xla/hlo/transforms/expanders/qr_expander.cc"
// --- RULE 1: namespace is authoritative ---------------------------------
if sym contains "xla::hilo::" or sym matches /(^| )hilo::/ : // upper- or lower-case hilo
return NEURON // owner is AWS's first-party tree; prefix "Neuron" is optional
// --- RULE 2: stock namespaces -------------------------------------------
if sym starts_with "xla::" and not contains "hilo" : return STOCK // bare xla::
if sym starts_with "xla::spmd::" : return STOCK // SPMD is upstream (Part 13)
if sym starts_with "mlir::mhlo::" or "mlir::stablehlo::" : return STOCK // the dialects themselves
// --- RULE 3: source-path corroboration (symbol absent/ambiguous) --------
if src starts_with "hilo/" : return NEURON
if src starts_with "xla/" or "mlir/" or "stablehlo/" : return STOCK
// --- RULE 4: emitted-op corroboration -----------------------------------
if pass emits/matches custom_call_target ~ /^AwsNeuron/ : return NEURON
// --- RULE 5: the absl LTS tag is a *type* fingerprint of imported XLA ----
if sym's Run signature carries "absl::lts_20230802::flat_hash_set" : return STOCK // weak
return NEEDS_REVIEW // e.g. a Neuron flag wrapping a stock pass: classify the BODY
Precedence and conflicts. Rules are tried in order; Rule 1 (namespace) wins over everything. The deliberate ordering encodes three facts learned from the binary:
- A pass can be
xla::hilo::without aNeuronprefix (PreserveControlDeps) → Rule 1 still tags it NEURON. Never gate on theNeuronprefix alone. - A Neuron flag (
--spmd,--expand-batch-norm-training) can schedule a stock pass → the flag does not appear inclassify; only the pass body's namespace does. This is theNEEDS_REVIEWescape: when handed "the pass behind--spmd," resolve it toxla::spmd::SpmdPartitionerfirst, then classify → STOCK. - The absl
lts_20230802tag (Rule 5) is a type-system fingerprint that brands imported XLA even where a symbol name is otherwise ambiguous; it is weak because Neuron'sxla::hilo::passes also takeabsl::lts_20230802::flat_hash_setarguments (they share the linked Abseil). Use it only to confirm STOCK, never to override ahilonamespace match.
QUIRK — the lowercase
hilo::(MLIR) and thexla::hilo::(HLO) namespaces are both Neuron and both matched by Rule 1, but they live in different binaries: the HLOxla::hilo::passes are inhlo-opt; the MLIRhilo::passes (NeuronControlDepTupleSimplifier,runStableHLOFrontendPipeline) are inhlo2penguin.nm -C hlo-opt | rg NeuronControlDepTupleSimplifier→ 0 hits. The binary a symbol lives in is itself a provenance/stage signal (HLO-level vs MLIR-level), orthogonal to stock-vs-Neuron.
5. The binary-offset caveat
hlo-opt is statically linked and large enough that its loadable segments do not start at file offset 0 of their section, so virtual address ≠ file offset. From readelf -SW hlo-opt:
[11] .rodata PROGBITS VMA 0x000000000020c940 fileoff 0x00c940 → VMA − off = 0x200000
[16] .text PROGBITS VMA 0x0000000001e6e960 fileoff 0x1c6d960 → VMA − off = 0x201000
[30] .data PROGBITS VMA 0x0000000009a27c00 fileoff 0x9824c00 → VMA − off = 0x203000
The IDA JSON sidecars (*_functions.json, *_strings.json, *_xrefs.json) and every address in the backing reports report virtual addresses. To read raw bytes off the on-disk file you must subtract the per-section delta first:
file_offset(.text VA) = VA − 0x201000 # e.g. PreserveControlDeps::Run VA 0x1f5c110 → off 0x1d5b110
file_offset(.rodata VA) = VA − 0x200000 # e.g. "AwsNeuronControlDep" VA 0x26e82c → off 0x6e82c
file_offset(.data VA) = VA − 0x203000
CORRECTION — an earlier convenience generalization that "for
.text/.rodatathe VMA equals the file offset" (true for some smaller Neuron libraries, e.g.libwalrus.soin 2.x) is false forhlo-opt. The two deltas differ from each other (0x201000for.text,0x200000for.rodata) and neither is zero. D-B29 records the same caveat in the formraw fileoff = VA − 0x200000(.rodata)/−0x201000(.text). Applying the wrong (or zero) delta lands a correct symbol in the wrong function — the most common single error reading this binary. Always resolve through the IDA JSON (which is VA-keyed) and convert only when you must touch raw bytes.
6. Ingestion artifact: recognized ≠ lowerable
A subtlety the ingestion boundary forces: because the whole stock XLA opcode vocabulary is statically linked, the HLO/StableHLO parser will accept ops that the Neuron device has no lowering for. Recognition at the input boundary is not the same as device support. The canonical example, fully worked in D-X11 §A:
stochastic-convertis an exact-match line inhlo-opt'sHloOpcodeString/StringToHloOpcodetable (strings | rg -x 'stochastic-convert'→ 1 hit). The text parser accepts it.- The full stock machinery is present and bare-
xla:::xla::HloEvaluator::HandleStochasticConvert,xla::ShapeInference::InferStochasticConvertShape,xla::HloInstruction::CreateStochasticConvert, and the expanderxla::StochasticConvertDecomposer::Run@0x27629b0(sourcexla/hlo/transforms/expanders/stochastic_convert_decomposer.cc). - There is no Neuron handler:
nm -C hlo2penguin | rg penguin | rg -ci stochastic→ 0; noxla::hilo::/penguin::StochasticConvert visitor exists. The stock decomposer rewrites the op into deterministic arithmetic before device lowering, or the op errors as un-lowerable.
The classification lesson: a pass or handler being present in the binary does not make it part of the Neuron device path. HandleStochasticConvert classifies STOCK (bare xla::, HloEvaluator is the reference interpreter) and is dead with respect to the device — a textbook case where the namespace marker correctly separates "linked-in upstream scaffolding" from "Neuron-authored device behavior." The same reasoning applies to the LLVM denormal-fp-math attributes and the NVPTX/AMDGPU ftz intrinsics that ride in with the linked LLVM (D-X11 §B): present in hlo-opt/hlo2penguin, bare-namespace, and irrelevant to NeuronCore numerics.
NOTE — when a Part-4 page documents a pass that touches a stock op (e.g. a Neuron combiner that consumes an
all-reduce), classify the pass, not the op. The op may be stockHloOpcode::kAllReduce; the combiner that rewrites it isxla::hilo::NeuronAllReduceCombiner→ NEURON. Provenance attaches to the transformation, not the data it transforms.
7. Worked classification table
Applying §4 to representative passes/handlers. "Marker hit" names the rule that fires. All symbol/string evidence re-verified by nm -C / strings -a against the cp310 binary.
| Pass / symbol | Binary | Namespace / source / op | classify() | Marker hit |
|---|---|---|---|---|
NeuronAllReduceCombiner::Run | hlo-opt | xla::hilo::Neuron… | NEURON | R1 namespace + R1 prefix |
NeuronCollectiveStreamIdInjector | hlo-opt | xla::hilo::Neuron… | NEURON | R1 |
PreserveControlDeps::Run | hlo-opt | xla::hilo:: (no prefix); src hilo/hlo_passes/PreserveControlDeps.cc; emits AwsNeuronControlDep | NEURON | R1 namespace (prefix absent) + R3 src + R4 op |
ConvertFSPatternsToCC | hlo-opt | xla::hilo::; src hilo/hlo_passes/ConvertFSPatternsToCC.cc | NEURON | R1 + R3 |
LegalizeAwsNeuronArgMax | hlo-opt | src hilo/hlo_passes/LegalizeAwsNeuronArgMax.cc; AwsNeuronArgMax | NEURON | R3 + R4 |
NeuronControlDepTupleSimplifier::runOnOperation | hlo2penguin | hilo:: (MLIR); arg flatten-control-dep-tuple-operands | NEURON | R1 (lowercase hilo::) |
AlgebraicSimplifier::Run | hlo-opt | bare xla:: | STOCK | R2 |
HloDCE / HloCSE / TupleSimplifier | hlo-opt | bare xla:: | STOCK | R2 |
BatchNormExpander (gated by --expand-batch-norm-training) | hlo-opt | bare xla::; flag is Neuron | STOCK | R2 (classify body, not flag) |
SpmdPartitioner (gated by --spmd) | hlo-opt | xla::spmd:: | STOCK | R2 (Part 13) |
ShardingPropagation::Run | hlo-opt | bare xla:: | STOCK | R2 |
StochasticConvertDecomposer::Run | hlo-opt | bare xla::; src xla/hlo/transforms/expanders/… | STOCK | R2 + R3 (§6) |
HloEvaluator::HandleStochasticConvert | hlo-opt | bare xla::; reference interpreter, device-dead | STOCK | R2 (recognized ≠ lowerable) |
ConvertStablehloToHlo | hlo2penguin | bare xla::; the StableHLO→HLO bridge | STOCK | R2 |
mlir::mhlo::* / mlir::stablehlo::* ops | hlo2penguin | the dialects themselves | STOCK | R2 |
8. Adversarial self-verification
The five strongest claims, re-checked against the binary; unprovable parts tagged.
-
"Neuron HLO passes are
xla::hilo::; stock are barexla::."nm -C hlo-opt | rg -c 'xla::hilo::'= 2,042;rg -c '\bxla::'= 51,551; sampled stock passes (AlgebraicSimplifier,HloDCE,SpmdPartitioner, …) all return 0 underxla::hilo::<Pass>and non-zero underxla::<Pass>/xla::spmd::<Pass>. CONFIRMED — the split is exact across every sample, no stock pass found insidexla::hilo::and no Neuron pass found in barexla::. -
"The
Neuronprefix is a hint; thexla::hilo::namespace is the rule."PreserveControlDepsandConvertFSPatternsToCCare demangled asxla::hilo::PreserveControlDeps/xla::hilo::ConvertFSPatternsToCC—xla::hilo::with noNeuronprefix — and both carryhilo/hlo_passes/*.ccsource strings. CONFIRMED — two independent markers (namespace + source path) agree, so gating on the prefix alone would mis-classify these as non-Neuron. -
"SPMD is stock, despite the Neuron
--spmdflag."nm -C hlo-opt | rg SpmdPartitionerresolves toxla::spmd::SpmdPartitioner/xla::spmd::StatefulRngSpmdPartitioner;xla::spmd::symbol-lines = 1,218; zeroxla::hilo::*Spmd*. The--spmdflag is a drivercl::opt(D-A01 §4). CONFIRMED — flag is Neuron, pass body is upstreamxla::spmd::. -
"
.textVMA−fileoff = 0x201000,.rodata= 0x200000."readelf -SW hlo-opt:.textVMA0x1e6e960/ off0x1c6d960→0x201000;.rodataVMA0x20c940/ off0xc940→0x200000. Independently matches the D-B14/D-B29 caveat. CONFIRMED — arithmetic re-derived from the live section table. -
"A
stochastic-convertis recognized at ingest but has no Neuron device lowering."strings hlo-opt | rg -x 'stochastic-convert'= 1 hit (opcode-table line);xla::StochasticConvertDecomposer::Runpresent @0x27629b0(barexla::);nm -C hlo2penguin | rg penguin | rg -ci stochastic= 0. CONFIRMED for HLO recognition + absence of a penguin handler. The routing (decomposed-away vs errored-as-unlowerable at the visitor) is STRONG/INFERRED per D-X11 §A.3 — the default-action string"<op> cannot be lowered."is confirmed present, but the exact opcode→default path was inferred from the absence of a case, not traced.
CORRECTION (scope honesty) — the 2,042 / 51,551 / 637 figures are
nm -Cdemangled symbol-line counts, not distinct-class or distinct-pass counts (one class yields many lines: ctor/dtor/Run/name/vtable/typeinfo/template instantiations). They are correct as namespace-surface proportions and as the basis for the marker test, but do not read "637" as "637 Neuron passes" — the distinctxla::hilo::Neuron*class count is ≥28 (§3), and the distincthilo/hlo_passes/*.ccfile count is 76. For a per-pass census see 4.1 the pass registry.
9. Cross-references
- 4.1 — hlo-opt pass registry: the per-pass census and registration order;
xla::hilo::RegisterHloPass@0x1ebc3f0,GetHloPassRegistry@0x1ebc570,hloPassRegistry(BSS) @0x9a38ee0. Every row there is classifiable by this page's algorithm. - 4.32 — hlo2penguin MLIR Pipeline Order & Entry Flow: the MLIR import path (
parseSourceFile/runStableHLOFrontendPipeline/ConvertStablehloToHlo) and the Penguin emitter that consume the post-classification graph. - front/control-deps — PreserveControlDeps & the control-dep custom-call (D-B29): the worked example of an
xla::hilo::-namespace, no-Neuron-prefix,AwsNeuron*-emitting Neuron pass, and thehilo::MLIR-side simplifier inhlo2penguin. - numeric/negative-results — recognized-but-unlowerable (D-X11): the full stochastic-convert /
denormal-fp-math/ftzworked cases for "linked-in upstream scaffolding ≠ Neuron device path." - Part 13 — SPMD: the stock
xla::spmd::SpmdPartitionerdocumented as upstream.