Skip to content

Conversation

@DrRyanHuang
Copy link
Contributor

@DrRyanHuang DrRyanHuang commented May 19, 2025

PR Category

Execute Infrastructure

PR Types

Improvements

Description

  • 添加之前PR72559的单测,以及修复PR72559中review的部分问题
  • 统一 ExceptionVariable 的设计,只有 Exception 才能直接创建 ExceptionVariable,不能传入 type[Exception]args 后,由 ExceptionVariable 创建
  • PR72559 导致 PaddleSeg_vit_adapter_bs4_fp32_DP_N1C1_d2sT 开启CINN 训练失败,主要原因是导入自定义模块无法正常 fallback,以下是最小复现代码
# 该文件为 import 的内容 # .venv/lib/python3.10/site-packages/ms_deform_attn-0.0.0-py3.10-linux-x86_64.egg/ms_deform_attn.py @strict_mode_guard(False) def test_import(self): def import_func(x): try: # x += 1 import ms_deform_attn x /= 2 except: # x *= 3 print( "Import ms_deform_attn failed.test/sot/test_24_exceptions.py" ) return x / 1 self.assert_results(import_func, paddle.to_tensor(0.5))

PCard-66972

@paddle-bot
Copy link

paddle-bot bot commented May 19, 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.

@paddle-bot paddle-bot bot added the contributor External developers label May 19, 2025
@SigureMo SigureMo changed the title [SOT] Add exception test && fix some param annotation [SOT][Exception] Add exception test && fix some param annotation May 19, 2025
@SigureMo
Copy link
Member

后续异常支持标题统一添加 [Exception],以便区分

@DrRyanHuang DrRyanHuang marked this pull request as draft May 20, 2025 08:06
@DrRyanHuang DrRyanHuang marked this pull request as ready for review May 21, 2025 10:17
@SigureMo
Copy link
Member

以下是最小复现代码

def fn(): try: psdb.breakgraph() raise ValueError except ValueError: print("Error catched!")

这应该才是最小复现样例(call breakgraph),这个是可以加到单测里的

@SigureMo
Copy link
Member

另外 #72827 已经退掉 3.8 了,这个 PR 就可以把 ALREADY_SUPPORTED_EXCEPTION 里的 >= 3.8 删掉了

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

除去之前说的问题,整体 ok

@DrRyanHuang
Copy link
Contributor Author

DrRyanHuang commented May 22, 2025

UPDATE:0604 DONE AT #73030


TODO:这个单测后续添加

class TestBuiltinFunctionRaiseExceptionGuard(TestCaseBase): def test_guard_run(self): def foo(x): 1 / x self.assert_results(foo, 1) self.assert_exceptions( ZeroDivisionError, "division by zero", foo, 0, )
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾

@DrRyanHuang DrRyanHuang changed the title [SOT][Exception] Add exception test && fix some param annotation [SOT][Exception][3.13] Add exception test && fix some param annotation May 23, 2025
@DrRyanHuang DrRyanHuang requested a review from SigureMo May 26, 2025 07:15
@SigureMo SigureMo changed the title [SOT][Exception][3.13] Add exception test && fix some param annotation [SOT][Exception] Add exception test && fix some param annotation May 26, 2025
@SigureMo SigureMo merged commit 278d6ed into PaddlePaddle:develop May 26, 2025
68 of 71 checks passed
@DrRyanHuang DrRyanHuang deleted the add_tst branch May 26, 2025 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

2 participants