Implement batch evaluation of RV shapes in get_plates#8033
Open
RohanAich wants to merge 3 commits intopymc-devs:mainfrom
Open
Implement batch evaluation of RV shapes in get_plates#8033RohanAich wants to merge 3 commits intopymc-devs:mainfrom
RohanAich wants to merge 3 commits intopymc-devs:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8033 +/- ##
=======================================
Coverage 91.44% 91.44%
=======================================
Files 116 116
Lines 19002 19005 +3
=======================================
+ Hits 17377 17380 +3
Misses 1625 1625
🚀 New features to boost your workflow:
|
Member
|
Good chance to fix #8024? We need something better than def get_symbolic_rv_shapes(
rvs: Sequence[Variable], raise_if_rvs_in_graph: bool = True
) -> tuple[TensorVariable]:
# TODO: docstrings
rv_shapes = [rv.shape for rv in rvs]
shape_fg = FunctionGraph(outputs=rv_shapes, features=[ShapeFeature()], clone=True)
with config.change_flags(optdb__max_use_ratio=10, cxx=""):
infer_shape_db.default_query.rewrite(shape_fg)
rv_shapes = shape_fg.outputs
if raise_if_rvs_in_graph and (overlap := (set(rvs) & set(ancestors(rv_shapes)))):
raise ValueError(f"rv_shapes still depend the following rvs {overlap}")
return tuple(rv_shapes)I would call it with |
Author
|
Thank you! This may take me a bit but I will try to get it done within the next few days. |
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement batch evaluation of RV shapes in ModelGraph.get_plates
Description
Implements the TODO in
ModelGraph.get_platesto evaluate all random variables (RV) shapes at once instead of indiviually.Related Issue
ModelGraph.get_platesType of change