-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
{'static_alloc': True, 'static_shape': True} ] | ||
for config in configs: | ||
layer = TestRNNLayer(cell_type, hidden_size) | ||
layer.initialize(ctx=mx.cpu(0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure about hardcoding the context?
seg = EngineOprSeg{false, nid + 1, nullptr}; | ||
} else if (is_async) { | ||
seg = EngineOprSeg{false, nid + 1}; | ||
seg.opr.reset(CreateEngineOp(default_ctx, seg_execs)); | ||
seg_execs.clear(); | ||
seg_start = nid + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract common code outside branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't. the code is used in "if" and "else if". it's not used in "else"
the PR will be updated after #11566 is merged. |
6f5b965
to
621a6d1
Compare
@eric-haibin-lin @piiswrong could you please review this PR? |
what's the new test case added for this? |
It's here. I tested the code in more CachedOp configurations. |
* fix a bug. * add tests. * use default context. * move all tests to test_contrib_control_flow.py * fix test.
Description
After adding kSubgraphExec, some logic in CachedOp is no longer valid. For example, an op executor that requires async execution may not contain output arrays. On the other hand, calling
CreateEngineOp
on op executors without output arrays can fail. This PR tries to fix this problem.Checklist
Essentials
Please feel free to remove inapplicable items for your PR.