[SOT][3.14] support `LOAD_SMALL_INT` op code by gouzil · Pull Request #76257 · PaddlePaddle/Paddle
PR Category
Execute Infrastructure
PR Types
Performance
Description
支持 LOAD_SMALL_INT 字节码
新通过的单测
test_02_store_inplace.pytest_08_rot.pytest_09_f_string.pytest_16_paddle_api.pytest_20_string.pytest_call_ast.pytest_call_object.pytest_dup_top.pytest_execution_base.pytest_guard_user_defined_fn.pytest_instruction_translator_cache.pytest_no_grad.pytest_output_restoration.pytest_pure_class.pytest_sot_place.pytest_symbolic_operation.pytest_user_specified_dynamic_dims.py
剩余单测 55
你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册。
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 the LOAD_SMALL_INT opcode, which was introduced in Python 3.14. This opcode optimizes loading small integer constants by providing a more efficient alternative to LOAD_CONST for frequently used small integers.
- Implements
LOAD_SMALL_INTopcode handler that wraps integer values as constant variables
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines +999 to +1002
| def LOAD_SMALL_INT(self, instr: Instruction): | ||
| int_value = instr.argval | ||
| int_var = ConstantVariable.wrap_literal(int_value, self._graph) | ||
| self.stack.push(int_var) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LOAD_SMALL_INT function is placed before the '# 3.14 opcodes' comment at line 1004, but it is itself a Python 3.14 opcode. For better code organization and consistency, this function should be moved after the comment to group it with other 3.14 opcodes (LOAD_FAST_BORROW, NOT_TAKEN, POP_ITER).
Copilot uses AI. Check for mistakes.
Codecov Report
❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@6cab4e7). Learn more about missing BASE report.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| .../sot/opcode_translator/executor/opcode_executor.py | 25.00% | 3 Missing ⚠️ |
❌ Your patch status has failed because the patch coverage (25.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files
@@ Coverage Diff @@ ## develop #76257 +/- ## ========================================== Coverage ? 25.00% ========================================== Files ? 1 Lines ? 4 Branches ? 0 ========================================== Hits ? 1 Misses ? 3 Partials ? 0
☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
gouzil
deleted the
sot/support_LOAD_SMALL_INT
branch
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