Skip to content

Conversation

@Dayuxiaoshui
Copy link
Contributor

PR Category

Description

- Enhanced replay_tensor() to support min_val and max_val clamping for all dtypes
- Updated convert_meta_classes_to_tensors() to handle constraints separately for int vs float
- Added min_val=0.0, max_val=1.0 constraints to reference_points tensors in:
  - IDEA-Research_grounding-dino-base
  - fushh7_llmdet_swin_tiny_hf
- This fixes NaN/inf issues caused by unchecked tensor value ranges

Related to: NO.112
- Enhanced replay_tensor() with numerical stability checks for floating-point tensors
- Added comprehensive min_val/max_val constraints to all tensors in weight_meta.py
- Replaced -inf with -1e6 in model.py to prevent NaN propagation in sigmoid operations
- Fixed std=0 case handling to avoid generating identical values
- Both nope and inductor backends now pass without NaN/inf

This completes the fix for NO.112 illegal torch samples.
… formatting

- Replaced -inf with -1e6 in fushh7_llmdet_swin_tiny_hf/model.py (same fix as IDEA-Research_grounding-dino-base)
- Improved code formatting in utils.py (removed trailing spaces, better line breaks)
- Both nope and inductor backends now pass without NaN for this sample
@paddle-bot
Copy link

paddle-bot bot commented Oct 30, 2025

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Oct 30, 2025
@Dayuxiaoshui
Copy link
Contributor Author

@luotao1 好像遇到点网络问题

@Dayuxiaoshui
Copy link
Contributor Author

@Xreki 请求检查一下

- Add -inf to -1e6 replacement logic in apply_templates for newly generated models
- Add runtime replacement logic in load_class_from_file for existing models
- Fix NaN issues in masked_fill and torch.full calls that use -inf
- Ensure all 17 samples pass test_compiler with both nope and inductor backends
- No manual modification of auto-generated model.py files required
- Add -inf to -1e6 replacement logic in apply_templates for newly generated models
- Add runtime replacement logic in load_class_from_file for existing models
- Fix NaN issues in masked_fill and torch.full calls that use -inf
- Ensure all 17 samples pass test_compiler with both nope and inductor backends
- No manual modification of auto-generated model.py files required
@Dayuxiaoshui
Copy link
Contributor Author

@Xreki @lixinqi 请求再次检查

- 从test_compiler.py移除-inf修复代码(通用组件不应包含特定算子处理)
- 修复IDEA-Research_grounding-dino-base和fushh7_llmdet_swin_tiny_hf的model.py,将-inf替换为-1e6
- 验证所有17个问题样本在inductor和nope后端均不再出现NaN
- 修复方案:仅在样本层面修复-inf问题,不修改通用组件
@lixinqi lixinqi merged commit acbc3e3 into PaddlePaddle:develop Nov 3, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants