Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or requestworkstream/integrationsExternal experiment and observability integrationsExternal experiment and observability integrationsworkstream/telemetryMemory data collectionMemory data collection
Description
Summary
Stormlog should generalize its runtime memory-sampling layer so non-CUDA backend models can participate in tracking and telemetry without pretending they expose CUDA-style allocator counters.
Why
Today the PyTorch-side collector and tracker path is still CUDA/MPS-shaped:
stormlog/device_collectors.pyrequires normalized samples withallocated_bytes,reserved_bytes,active_bytes, andinactive_bytes.stormlog/tracker.pyonly acceptscudaormpsdevices for GPU tracking.stormlog/profiler.pyis hard-wired totorch.cuda.*for bounded profiling.stormlog/telemetry.pyassumes allocator-centric event fields are always available.
That works for CUDA/ROCm/MPS, but it is too narrow for runtimes such as TorchTPU/XLA or JAX, where the stable signals may be closer to device used/free/total memory than allocator-reserved/active/inactive counters.
Proposed direction
Introduce a backend capability model that separates:
- allocator-level counters that are present only on backends that actually expose them
- device-level capacity/usage counters that are available across more runtimes
- feature flags for unsupported capabilities such as native allocator history, fragmentation analysis, or allocator attribution
This should keep the shared session/telemetry/TUI artifact layer intact while making the runtime-facing collectors and trackers honest about what they can measure.
Scope
- Generalize
DeviceMemoryCollectorso backends can report partial capability sets without faking CUDA allocator semantics. - Update tracker export paths to tolerate missing allocator-only fields where the backend does not expose them.
- Preserve session-aware telemetry, distributed identity, and TUI loading.
- Add explicit capability metadata so CLI/TUI/reporting can say when allocator-centric analysis is unavailable.
Non-goals
- Full feature parity for every backend in one change.
- Rewriting CUDA-native attribution/history to work on non-CUDA runtimes.
- Adding TorchTPU or JAX support directly in this issue.
Acceptance criteria
- The collector/tracker contract can represent backends that only expose device-level memory info.
- Telemetry exports and loaders remain stable for existing CUDA/ROCm/MPS workflows.
- CLI/TUI surfaces degrade explicitly when allocator-native features are unavailable.
- This work leaves a clean path for follow-up runtime issues such as TorchTPU and JAX.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestworkstream/integrationsExternal experiment and observability integrationsExternal experiment and observability integrationsworkstream/telemetryMemory data collectionMemory data collection
Activity
Silas-Asamoah commentedon Oct 2, 2026
Closing as completed: #229 delivered this and shipped in v0.3.10. That PR said "Closes #126", but it merged into
release/dev, so the keyword didn't fire.What it covered against the acceptance criteria:
DeviceMemoryCapabilitiesdeclares per-counter and allocator-feature support,DeviceMemorySamplecounters are nullable, andMemoryTracker(..., collector=...)accepts an injected collector.TelemetryEventV4exports with capability metadata, plus conservative v2/v3 and legacy upgrades. CUDA, ROCm and MPS sampling is unchanged.N/A, and report a reason instead of a finding for unsupported fragmentation, gap and attribution analyses.