Skip to content

Conversation

@SigureMo
Copy link
Member

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

#73506 中实现的 move to front 并没有 inplace 修改,因此实际上并没有生效,本 PR 修复

@SigureMo SigureMo requested a review from Copilot June 21, 2025 07:44
@paddle-bot
Copy link

paddle-bot bot commented Jun 21, 2025

你的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.

@SigureMo SigureMo changed the title [SOT] Fix guarded fns is not inplace update [SOT][3.13] Fix guarded fns is not inplace update Jun 21, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Ensures that the guarded_fns list is updated in-place when moving a hit to the front, fixing the previous non-in-place reassignment.

  • Switched from rebinding guarded_fns to using slice assignment for in-place update.
Comments suppressed due to low confidence (1)

python/paddle/jit/sot/opcode_translator/executor/executor_cache.py:268

  • Add a unit test to verify that accessing a guarded function moves it to the front of guarded_fns in-place, ensuring this behavior is covered.
 guarded_fns[:] = [ 
# Note: Be cautious when modifying the order of elements in a list during iteration,
# as it can lead to unexpected behavior.
guarded_fns = [
guarded_fns[:] = [
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using guarded_fn = guarded_fns.pop(index); guarded_fns.insert(0, guarded_fn) for a more idiomatic in-place move that avoids allocating a new list.

Copilot uses AI. Check for mistakes.
@SigureMo SigureMo changed the title [SOT][3.13] Fix guarded fns is not inplace update [SOT] Fix guarded fns is not inplace update Jun 22, 2025
@SigureMo SigureMo merged commit e47977d into PaddlePaddle:develop Jun 22, 2025
71 of 77 checks passed
@SigureMo SigureMo deleted the sot/fix-guarded-fns-is-not-inplace-update branch June 22, 2025 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants