CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[SOT] Add collections.namedtuple
support
#72495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SOT] Add collections.namedtuple
support
#72495
Conversation
ไฝ ็PRๆไบคๆๅ๏ผๆ่ฐขไฝ ๅฏนๅผๆบ้กน็ฎ็่ดก็ฎ! |
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.
Pull Request Overview
This PR adds support for collections.namedtuple to avoid OOM issues caused by holding tensor objects directly. The changes include new tests for namedtuple support, a helper function to identify namedtuple classes, and the introduction of new variable classes to correctly wrap and handle namedtuple instances.
- Added test cases in the SOT test suite.
- Introduced is_namedtuple_class in utils and exported it.
- Implemented NamedTupleVariable and NamedTupleClassVariable to support namedtuple operations.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test/sot/test_collections_namedtuple.py | New tests ensuring namedtuple support and proper functionality with tensors. |
python/paddle/jit/sot/utils/utils.py | Added is_namedtuple_class to detect namedtuple classes based on attributes. |
python/paddle/jit/sot/utils/init.py | Exported is_namedtuple_class for usage in other modules. |
python/paddle/jit/sot/opcode_translator/executor/virtual_frame.py | Removed temporary signature_clear_guard usages and updated locals population with fn_bind_inputs. |
python/paddle/jit/sot/opcode_translator/executor/variables/container.py | Introduced NamedTupleVariable to wrap namedtuple instances. |
python/paddle/jit/sot/opcode_translator/executor/variables/callable.py | Added NamedTupleClassVariable to support namedtuple classes. |
python/paddle/jit/sot/opcode_translator/executor/variables/base.py | Reintroduced signature_clear_guard and updated fn_bind_inputs. |
python/paddle/jit/sot/opcode_translator/executor/variables/container.py
Outdated
Show resolved
Hide resolved
โฆtainer.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #72495 +/- ##
==========================================
Coverage ? 97.36%
==========================================
Files ? 5
Lines ? 76
Branches ? 0
==========================================
Hits ? 74
Misses ? 2
Partials ? 0 โ View full report in Codecov by Sentry. ๐ New features to boost your workflow:
|
* [SOT] Add namedtuple support * Update python/paddle/jit/sot/opcode_translator/executor/variables/container.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refine type --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
PR Category
Execute Infrastructure
PR Types
Bug fixes
Description
ๆทปๅ
collections.namedtuple
ๆฏๆ๏ผ้ฟๅ ๅ ถไธญๆๆ Tensor ๆถๅๅฏผ่ด OOM๏ผ่ฟไนๅๆฏObjectVariable
๏ผๆฏ็ดๆฅๆๆ Tensor ็๏ผๅ็ปญ้่ฆๆณไธ็งๆนๆณ้ฟๅ ็ฑปไผผๆ ๅต