Rework call site identification#6298
Conversation
653ab9a to
3b45192
Compare
Greptile SummaryThis PR replaces the hardcoded frame-skip depth used for call-site identification in dynamic mode with a cleaner Confidence Score: 5/5Safe to merge; the refactoring is correct and all remaining findings are P2 style suggestions. The core transparent-frame logic is sound: mark_transparent correctly follows wrapped chains, resolve_callsite_frame reliably walks past all internal wrappers, and the Invocation assertion in schedule() is safe because _call_stack is always populated when EvalMode is eager. The only P2 finding is a minor performance inconsistency in _batch2tensor.py (missing the same EvalMode guard that _op_builder.py already applies). _batch2tensor.py — minor EvalMode guard omission; no correctness impact. Important Files Changed
|
|
!build |
|
CI MESSAGE: [48516693]: BUILD STARTED |
| from . import _device, _invocation, _op_builder | ||
| from ._batch import Batch, Tensor, as_batch, batch | ||
| from ._callsite import mark_transparent, resolve_callsite_frame |
There was a problem hiding this comment.
Please refrain from reorganizing imports, especially with other PRs in flight.
There was a problem hiding this comment.
This is not a file that's very likely to be changed by other PRs. Other PRs currently in flight don't touch it.
63286e6 to
f02d3e2
Compare
|
!builld |
|
!build |
|
CI MESSAGE: [48675105]: BUILD STARTED |
Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
f02d3e2 to
0edcbea
Compare
|
!build |
|
CI MESSAGE: [48676204]: BUILD STARTED |
|
CI MESSAGE: [48676204]: BUILD PASSED |
Category:
Refactoring (Redesign of existing code that doesn't affect functionality)
Description:
Call site identification for stack trace doctoring in dynamic mode is currently performed with hardcoded values to skip dynamic mode's internal plumbing. Although tested, this is brittle and can break easily when the code changes.
This PR removes the hardcoded values and replaces it by marking internal frames "transparent". Identification is then performed by walking up the stack trace, skipping transparent frames. Even if this is done for all calls to DALI functions, the overhead should be small as there are typically not more than 6 frames to walk up.
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A