Introducing ModuleLens: Zooming into PyTorch Modules for Human and Agentic Engineering
ModuleLens lets Pinterest ML engineers capture any PyTorch module from a sharded multi-GPU recommendation model and rebuild it locally within seconds, replacing full-model initialization with a "module-first" workflow. A ModuleTracer uses forward hooks to record inputs, outputs, state_dicts and runtime metadata. It captures __init__ arguments by patching Python's __import__ and stops tracing after a single post-warmup training step, logging only shapes for large tensors and deduplicating shared ones. Captured modules are versioned in a Weights & Biases Registry, indexed by a hash of model and module name, and consumed through a Jupyter extension, an IPython CLI, and Agent Skills for LLM agents. Internal uses include a training bottleneck analyzer, an LLM-driven GPU kernel generator, and scaling-law ROI tooling.
Related posts
- Introducing Trackio: A Lightweight Experiment Tracking Library from Hugging Face
Hugging Face mediumAdeptTrackio is a free, open-source Python experiment tracking library that works as a drop-in replacement for wandb's init/log/finish API. It shows runs in a local Gradio dashboard and can sync to Hugging Face Spaces for sharing or iframe embedding. On Spaces, metrics go to an ephemeral SQLite database that is converted to Parquet and backed up to a Hugging Face Dataset every 5 minutes. It integrates with transformers Trainer and Accelerate, keeps its core under 1,000 lines, and is in beta without artifact management or complex visualizations.
- Learn the Hugging Face Kernel Hub in 5 Minutes
Hugging Face mediumAdeptHugging Face's Kernel Hub and `kernels` library let PyTorch code download pre-compiled, optimized GPU kernels such as FlashAttention, activations, RMSNorm and quantization kernels with a single `get_kernel` call. The library matches the binary to the installed Python, PyTorch and CUDA versions, which avoids source builds that for FlashAttention can need about 96 GB of RAM and hours of compilation. The walkthrough checks a fast GELU kernel against PyTorch and swaps a Triton LlamaRMSNorm into a simple model with the `use_kernel_forward_from_hub` decorator. It then benchmarks the kernel against a plain PyTorch RMSNorm using CUDA events.
- Improving Deep Agents with harness engineering
LangChain mediumAdeptChanging only the harness around a fixed model (gpt-5.2-codex) raised deepagents-cli from 52.8% to 66.5% on Terminal Bench 2.0, moving it from outside the top 30 to the top 5. The gains came from an automated trace-analysis loop over LangSmith traces and targeted changes to the system prompt and middleware. These included a pre-completion checklist that forces a verification pass, injected directory and tool context, time-budget warnings, and loop detection after repeated edits to the same file. A high-xhigh "reasoning sandwich" that spends more compute on planning and verification beat running at xhigh throughout, which scored 53.9% because of timeouts. Harnesses also need tailoring per model: Claude Opus 4.6 scored 59.6% on an earlier harness that had not been through the same improvement loop.
- Does Your Model Run on AWS Trainium? Look It Up
Hugging Face mediumAdeptA Hugging Face Space reports whether popular Transformers models run unmodified on AWS Trainium via the TorchNeuron PyTorch backend. For each model it shows the result, the number of Trainium cores used, wall time including compilation, peak device memory, and the run.py script to reproduce it. Each test shards the model with tensor or expert parallelism over the fewest trn2 cores that hold it, generates 32 tokens, and checks them against a CPU run or with a judge model. A PASS says nothing about throughput or long generations. Results are published as a queryable Parquet dataset, and precompiled NEFF graphs can be synced from a public cache to skip compilation.
- Introducing Daggr: Chain apps programmatically, inspect visually
Hugging Face mediumAdeptDaggr is an open-source Python library from the Gradio team for chaining Gradio Spaces, Hugging Face Inference Providers models and custom Python functions into workflows defined in code, with an automatically generated visual canvas. The canvas lets you inspect intermediate outputs, change inputs and rerun individual steps, while state, cached results and multiple "sheets" persist between sessions. Three node types are covered: GradioNode, which can clone and run a Space locally with remote fallback; FnNode; and InferenceNode. A walkthrough builds an image-to-3D pipeline from background removal, downscaling, FLUX.2-klein and TRELLIS.2. The library is in beta, so APIs may change and data loss is possible during updates.