CARVIEW |
Select Language
HTTP/2 200
date: Wed, 23 Jul 2025 10:49:02 GMT
content-type: text/html; charset=utf-8
cache-control: no-cache
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
referrer-policy: no-referrer-when-downgrade
server-timing: pull_request_layout-fragment;desc="pull_request_layout fragment";dur=332.417095,conversation_content-fragment;desc="conversation_content fragment";dur=994.296285,conversation_sidebar-fragment;desc="conversation_sidebar fragment";dur=315.636764,nginx;desc="NGINX";dur=0.613892,glb;desc="GLB";dur=100.766901
strict-transport-security: max-age=31536000; includeSubdomains; preload
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-content-type-options: nosniff
x-frame-options: deny
x-voltron-version: fd8fbbc
x-xss-protection: 0
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=oYUXg2foPFVDjGjmfCLlSFsyC1XZx6j2GoPwM0RIBL92cpfK9IU4fUTNk16IT0ERiq73Ct0u3o8Rc6YFCobLVu6oDthbXlm5IG%2FhrJHr0Ua8Rx5BUmeHLcZAWVrE3uZOb0epuSykjZklN75A3ZZvLQ1rzVqkisA4y2dj6aOlJf2HNv4RJa0UooFFlURnL3vNdTgruylot2%2BJroBkYLSZfI8o8OvZUBmRWLyZkn197%2FvFH6zho8cfzOparoQ%2Fd%2BQaHjLv7sC76ORcKRLCOkiPog%3D%3D--IjHYdxz0ohC8hixW--lFHGrBsSnynDwKGVKEQwKA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.669795765.1753267741; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 10:49:01 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 10:49:01 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 9F58:941DF:9A2DFB:BA1862:6880BE1D
[SOT] Add unsafe cache fast path by DrRyanHuang · Pull Request #73372 · PaddlePaddle/Paddle · GitHub
SigureMo
changed the title
[SOT][3.13] Add unsafe cache fast path
[SOT] Add unsafe cache fast path
Jun 17, 2025
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[SOT] Add unsafe cache fast path #73372
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
Merged
Merged
+119
−0
Conversation
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
SigureMo
reviewed
Jun 16, 2025
python/paddle/jit/sot/opcode_translator/executor/executor_cache.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/executor_cache.py
Outdated
Show resolved
Hide resolved
加个单测 |
SigureMo
reviewed
Jun 17, 2025
python/paddle/jit/sot/opcode_translator/executor/executor_cache.py
Outdated
Show resolved
Hide resolved
Comment on lines
78
to
85
cache: dict[ | ||
types.CodeType, tuple[GuardedFunctions, paddle.framework.core.GuardTree] | ||
] | ||
translate_count: int | ||
code_symbolic_inputs: dict[types.CodeType, dict[str, None | dict[int, int]]] | ||
compile_time_stats: dict[types.CodeType, float] | ||
consecutive_cache_hit_count: dict[types.CodeType, int] | ||
last_cache_index: dict[types.CodeType, int | None] |
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.
TODO: 太多 code 相关状态,后续单独拆出来一个 class 用来管理这些状态,OpcodeExecutorCache
用来管理 code 到这个状态的映射
SigureMo
approved these changes
Jun 17, 2025
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.
huangjiyi
pushed a commit
to huangjiyi/Paddle
that referenced
this pull request
Jun 18, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You can’t perform that action at this time.
PR Category
Execute Infrastructure
PR Types
Improvements
Description
在推理场景下,通常只会命中同一个 cache,但目前每次都需要重新执行 guard 检查,这其实没有必要。因此,我们可以启用一种不安全的优化策略:如果同一个 cache 被连续命中超过一定次数(例如 32 次),则可以认为输入数据没有发生变化,直接返回该 cache,跳过 guard 检查,以提升推理效率。
这个策略通过环境变量
SOT_UNSAFE_CACHE_FASTPATH
开启收益:(稳定后)某模型单Token时间从 35.9ms -> 29.8ms
cc @SigureMo
PCard-66972