r/MachineLearning • u/AutoModerator • Oct 02 '26
Discussion [D] Self-Promotion Thread
Please post your personal projects, startups, product placements, collaboration needs, blogs etc.
Please mention the payment and pricing requirements for products and services.
Please do not post link shorteners, link aggregator websites , or auto-subscribe links.
--
Any abuse of trust will lead to bans.
Encourage others who create new posts for questions to post here instead!
Thread will stay alive until next one so keep posting after the date in the title.
--
Meta: This is an experiment. If the community doesnt like this, we will cancel it. This is to encourage those in the community to promote their work by not spamming the main threads.
View all comments
1
u/cosmicBb0y ML Engineer Oct 14 '26
Pandera is a dataframe validation library (disclosure: I created Pandera and work at Union AI, which stewards it) and 0.34 adds support for validating pytorch
TensorDicts. I added it because many of the training bugs I encounter when I train RL models are data-related bugs:These tensors all had implicit contracts that weren't actually checked.
A
TensorDictmaps onto a dataframe schema pretty directly. Keys play the role of columns, each tensor's dtype and shape play the role of a column dtype, andbatch_sizeis the row count:It works on TensorDicts,
lazy_stackresults, and@tensorclassinstances. You also getinfer_schemafrom a known-good batch, YAML/JSON serialization,coerce=Truefor dtype casting, and Hypothesis strategies that generate schema-valid batches for property tests.What it costs to validate. I timed
validate()against the training step of an MLP policy on CPU, holding the 256-row batch and schema fixed while the model grew from 9K to 17M parameters.What it costs not to validate. I wanted to get at what it costs to not validate the training data. I trained REINFORCE on CartPole and corrupted 1%, 5%, or 20% of batches, either with a NaN reward (the weights go NaN, the next rollout crashes, and the loop rolls back to its last good checkpoint) or with observations scaled 100x (nothing crashes). The metric is environment steps to reach a 475 return, counting steps lost to rollbacks and skipped batches, over 30 seeds per cell:
(Relative to a clean run, which took about 70K steps.) Validation took 0.5% of wall-clock time in those runs. The crash was the cheap failure, since it costs at most a checkpoint interval, and the silent one was the expensive failure, since nothing stops the loop from learning from bad data.
Caveats: these are CPU numbers on small models. CartPole recovers from bad updates quickly and the checkpoints were only 10 updates apart, so I'd expect a larger model with sparser checkpoints to pay more, but I haven't measured that yet. Corruption rates are per batch, not per row. Building the harness also turned up a subtle trap:
Optimizer.load_state_dictkeeps references to the tensors you give it, so restoring a checkpoint directly let the next NaN update poison the stored checkpoint (one run crashed 574 times before I fixed it).Gaps in this first version:
("next", "observation")aren't supported yet, which matters for TorchRL users.TensorDictModelfields don't accept custom checks yet, so one-off checks need the object API.I'd love to hear from people using TensorDict or TorchRL: is nested-key support the first thing you'd need, or something else? Do you encounter any of these failure modes and what do you do today to check them? Do you use assert statements?
Post with charts: https://www.union.ai/blog-post/pandera-0-34-tensordict Benchmark code (Flyte scripts, each runs locally with
--local):