[Feature] Add `functional_vmap` to call a module with stacked parameter sets #3327
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 214 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.321
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3327"
general
weight: 0.35
phoeenniixx
Description
Adds
tensordict.nn.functional_vmap.Tests:
TestFunctionalVmapintest/nn/test_nn.pycovers:- a plain module with inputs in args and in kwargs
- a
TensorDictModule- a module that takes its own params argument
- params with batch sizes
[],[6]and[2, 3]- mapped and shared inputs
- the shape and name errors
- chunk_size and randomness
-
nn.GRUwithloop=True-
loop=Trueagainstvmap, for both outputs and gradients.test_functional_vmapintest/compile/test_compile.py runs both paths withtorch.compile(fullgraph=True).Motivation and Context
Closes #2813.
Adds a function to call a module with a stack of parameter sets, with a loop fallback for modules that
vmaprejects.Types of changes
What types of changes does your code introduce? Remove all that do not apply:
Checklist
Go over all the following points, and put an
xin all the boxes that apply.If you are unsure about any of these, don't hesitate to ask. We are here to help!