kempnerpulse.translate.translator

Layer 2 orchestrator — turn a RawRecord into a CanonicalRecord.

Per record: map source field names to canonical names, normalize units, drop missing readings to None, resolve entity identity, stamp the static source context (provenance, aggregation mode, host/cluster metadata), assemble the immutable CanonicalRecord, and validate it.

Value-changing source corrections (e.g. treating the NVLink gauge as a counter to difference) are intentionally not applied here — NVLink is normalized as a gauge (MB/s → bytes/s) so the observable values are preserved.

Functions

make_translator(backend, **context_kwargs)

Construct a Translator with a backend-derived SourceContext.

Classes

Translator

Maps RawRecord objects to CanonicalRecord objects under a fixed SourceContext.

class kempnerpulse.translate.translator.Translator[source]

Bases: object

Maps RawRecord objects to CanonicalRecord objects under a fixed SourceContext.

__init__(ctx)[source]
Parameters:

ctx (SourceContext)

Return type:

None

translate(raw)[source]

Translate one record. Returns None for non-GPU entities.

Parameters:

raw (RawRecord)

Return type:

CanonicalRecord | None

translate_tick(records)[source]

Translate a tick’s worth of records, dropping non-GPU entities.

Parameters:

records (Iterable[RawRecord])

Return type:

List[CanonicalRecord]

kempnerpulse.translate.translator.make_translator(backend, **context_kwargs)[source]

Construct a Translator with a backend-derived SourceContext.

Parameters:

backend (BackendKind)

Return type:

Translator