Skip to content

Deep memory profiling + real-time dashboard#1

Closed
polymood wants to merge 4 commits into
mainfrom
feat/deep-memory-realtime
Closed

Deep memory profiling + real-time dashboard#1
polymood wants to merge 4 commits into
mainfrom
feat/deep-memory-realtime

Conversation

@polymood

@polymood polymood commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Turns DaskGenie into a memray-deep, real-time Dask memory profiler and team dashboard.

Highlights

  • Deep memory (memray as a library). Per-line high-water-mark attribution folded to your source line, full call stacks for a per-worker flamegraph / memray-style tree. Opt-in deep=True; degrades safely where memray isn't available. Schema v6.
  • Real-time dashboard. WebSocket-streamed Next.js app: live Workers table, global + per-worker zoomable Task stream, whole-graph canvas DAG, memory-over-time with a click-to-inspect spike explorer, per-layer allocations over time, deep flamegraph. Collapsible sidebar, in-app modals, Dask warm palette + logo.
  • TimescaleDB backend (hypertables) as default behind a StoreProtocol, SQLite kept for tests/dev. Prometheus /metrics retained.
  • Team hub. Runs record origin hostname + IP.
  • Examples across Dask. distributed/deep OOM demos, a minutes-long pipeline, a self-limiting crash, and one per collection type (delayed, dataframe, bag, xarray on Zarr and NetCDF).
  • Packaging. PyPI metadata, MIT LICENSE, CI (ruff + mypy + pytest + package/web build).

Verification

  • ruff + ruff format + mypy clean; unit + deep-distributed integration tests pass.
  • uv build produces a clean wheel + sdist; web builds clean.
  • Exercised end-to-end against the dockerized Timescale stack (deep OOM run attributes the OOM line; flamegraph, per-layer timeline, spike inspector verified).

Notes / limitations

  • Source-line attribution is strongest for dask.array / dask.delayed; for dask.dataframe (dask-expr) and xarray the heavy work is in library C code, so allocations fold to framework frames (graph/memory/flamegraph still work).
  • memray is Linux/macOS + CPython; a hard OOM kill can lose the final epoch (Memory tab remains the reliable culprit view).
  • TimescaleDB path verified live; SQLite remains the test backend.

🤖 Generated with Claude Code

polymood added 4 commits July 3, 2026 16:49
Fuse memray-deep allocation tracing with the Dask task graph and stream it live.

- deepmem: memray driven as a library, epoch-rotated, folded to the first user
  source line; captures per-line high-water marks and full call stacks (schema
  v6). Opt-in via deep=True on register()/LocalProfiler; degrades to Tier-1
  sampling where memray isn't importable. Never crashes or OOMs the job.
- Worker plugin emits live WorkerStatus heartbeats + deep epochs; scheduler
  plugin death events joined with chunk metadata and allocation lines.
- Collector: TimescaleDB backend (hypertables) as default behind a StoreProtocol,
  SQLite kept for tests/dev; asyncio pub/sub hub + /ws WebSocket fan-out;
  per-line, per-task, per-layer-timeline, flamegraph and worker endpoints.
- Runs record origin hostname + IP so a shared collector is a team hub.
- Source attribution reads the full multi-line statement, not just one line.
Next.js dashboard streaming over WebSocket, in Dask's warm palette.

- Live store (WebSocket + REST seed) with a collapsible runs sidebar that updates
  in real time; activity-based live indicator.
- Workers table, global + per-worker Task stream (canvas, zoom/pan/box-zoom),
  whole-graph canvas DAG with deep zoom + edge highlighting.
- Memory: canvas memory-over-time with click-to-inspect spike explorer, per-layer
  allocations-over-time, a real per-worker icicle flamegraph (memray tree read),
  and the peak-by-line / peak-by-task tables.
- Dedicated Timeline page, in-app delete modal, SVG logo + favicon.
- examples covering the breadth of Dask: distributed/deep OOM demos, a
  minutes-long big pipeline, a self-limiting crash, and one per collection type
  (dask.delayed, dask.dataframe, dask.bag, xarray on Zarr and NetCDF).
- Packaging: PyPI metadata (authors, urls, classifiers), MIT LICENSE.
- CI workflow: ruff + mypy + pytest + package build + web build.
- README rewritten; examples/README expanded.
- .github/workflows/workflow-pypi.yml: on a v* tag, build + publish to PyPI via
  Trusted Publishing (OIDC, no token), push collector + dashboard images to GHCR,
  and create the GitHub release.
- CONTRIBUTING.md: two-trunk model, Conventional Commits, uv/ruff/mypy/pytest,
  release process.
- CHANGELOG.md (Keep a Changelog) and daskgenie.__version__.
- .pre-commit-config.yaml running ruff + mypy via uv.
@polymood
polymood force-pushed the feat/deep-memory-realtime branch from ec521eb to 6aad1ab Compare July 3, 2026 14:59
@polymood

polymood commented Jul 3, 2026

Copy link
Copy Markdown
Owner Author

Work already merged into main; switching to the develop-based two-trunk flow. Superseded.

@polymood polymood closed this Jul 3, 2026
@polymood
polymood deleted the feat/deep-memory-realtime branch July 3, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant