Skip to content

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Oct 2, 2025

PR Category

Execute Infrastructure

PR Types

Improvements

Description

Sometimes we need to temporarily disable the torch proxy. For example, in flashinfer, we need to disable the proxy when importing tvm-ffi.

with paddle.compat.use_torch_proxy_guard(enable=False):
    import tvm_ffi

tvm-ffi contains code like:

try:
    import torch
except ModuleNotFoundError:
    torch = None

We do not want tvm-ffi to recognize PaddlePaddle as torch, so we need to temporarily disable this proxy during that import.

Copy link

paddle-bot bot commented Oct 2, 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.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@b51d97f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
python/paddle/compat.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop   #75651   +/-   ##
==========================================
  Coverage           ?   91.66%           
==========================================
  Files              ?        1           
  Lines              ?       12           
  Branches           ?        0           
==========================================
  Hits               ?       11           
  Misses             ?        1           
  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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants