Skip to content

Conversation

@gongshaotian
Copy link
Contributor

@gongshaotian gongshaotian commented Jan 22, 2025

PR Category

CINN

PR Types

Improvements

Description

Pcard-67164
After this PR merged, infer_symbolic and CINN will be strongly bound.

  • Delete FLAGS_pir_apply_shape_optimization_pass
  • Delete the call of shape_optimization_pass in infer_mode
  • Delete the call of shape_optimization_pass in trt
  • Delete the test case of reshape and split op to avoid "sym_shape_str" bug

Hongqing-work
Hongqing-work previously approved these changes Jan 22, 2025
zyfncg
zyfncg previously approved these changes Jan 22, 2025
phlrain
phlrain previously approved these changes Jan 23, 2025
@gongshaotian gongshaotian dismissed stale reviews from zyfncg, phlrain, and Hongqing-work via 589ab79 February 6, 2025 12:42
@gongshaotian gongshaotian changed the title [CINN]Delete FLAGS_pir_apply_shape_optimization_pass [CINN]Delete shape_optimization flag And Refine ApplyCinnPass Feb 8, 2025
@gongshaotian gongshaotian changed the title [CINN]Delete shape_optimization flag And Refine ApplyCinnPass [CINN]Delete shape_optimization Flag And Refine ApplyCinnPass Feb 8, 2025
@gongshaotian gongshaotian changed the title [CINN]Delete shape_optimization Flag And Refine ApplyCinnPass [CINN]Delete shape_optimization flag And Refine ApplyCinnPass Feb 8, 2025
github-merge-queue bot pushed a commit to deepmodeling/deepmd-kit that referenced this pull request Feb 8, 2025
We verified paddle CINN compiler in DPA-2 example(single A100-SXM (40G),
cada11.8, Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz x 160).

To enable CINN compiler in training, add one flag: `CINN=1` before
training command, e.g. `CINN=1 dp --pd train input_torch_medium.json`.

### Curves:
#### dpa2

![e9eb3013dc154b03172a0c1881507c8e](https://github.com/user-attachments/assets/3cfe2c1f-badd-414e-bb51-f59791f641e1)

##### Performance 

We tested with torch==2.6.0.dev20241219+cu118
| Pytorch(eager) | Pytorch(compile) | Paddle(eager) | Paddle(CINN
compile) |
| -- | -- | -- | -- |
| 0.1078s/step | compile do not support double-backward | 0.1130s/step |
0.0638s/step |

#### se_atten

![image](https://github.com/user-attachments/assets/c4c2cdaa-6cbb-4a67-8639-598a094472bc)

##### Performance 

We tested with torch==2.6.0.dev20241219+cu118
| Pytorch(eager) | Pytorch(compile) | Paddle(eager) | Paddle(CINN
compile) |
| -- | -- | -- | -- |
| 0.0342s/step | compile do not support double-backward | 0.0444s/step |
0.0244s/step |

### Accuracy details:

#### dpa2
- Pytorch:

![image](https://github.com/user-attachments/assets/d74528e9-11eb-432b-b7cc-bf568b224dcb)

- Paddle(eager mode):

![image](https://github.com/user-attachments/assets/dc17b5d2-7f13-498c-9398-9d4c1a9a1e22)

- Paddle(CINN compiler)

![1da419d9d8b27981cfd3a1067e30ce6f](https://github.com/user-attachments/assets/f20286a1-6088-4f6f-b667-2b4763a438b5)

#### se_atten
- Pytorch

![image](https://github.com/user-attachments/assets/be46fd72-2db9-451b-9c2c-d5c382b75c6f)

- Paddle(eager_mode)

![image](https://github.com/user-attachments/assets/cffeedf8-26dd-4142-830b-af5106805e52)

- Paddle(CINN compliler)

![image](https://github.com/user-attachments/assets/971a9476-703f-4765-81b9-c45311cc803f)


### TODO:
- [x] Fix high order backward of control flow in
Paddle(PaddlePaddle/Paddle#70545)
- [ ] Fix shape64
issue(PaddlePaddle/Paddle#70947)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced training performance through optimization techniques that
leverage compilation and profiling for better execution monitoring.
- Introduced a new function for converting various input types to
boolean values, improving environment variable handling.

- **Refactor**
- Improved precision management for training parameters and updated
environment configuration handling to ensure robust optimization
support.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
YuanRisheng
YuanRisheng previously approved these changes Feb 11, 2025
@zyfncg zyfncg merged commit 3912864 into PaddlePaddle:develop Feb 12, 2025
38 checks passed
fangfangssj pushed a commit to fangfangssj/Paddle that referenced this pull request Feb 18, 2025
…Paddle#70947)

* add FLAGS_check_jit_instrction_shape

* add log

* add flag in runtime/flags

* fix

* tix typo

* delete FLAGS_pir_apply_shape_optimization_pass

* delete symbolic shape pass in trt

* delete the test case of reshape and split op
@gongshaotian gongshaotian deleted the delete_apply_flag branch March 7, 2025 08:41
YqGe585 pushed a commit to YqGe585/Paddle that referenced this pull request May 7, 2025
…Paddle#70947)

* add FLAGS_check_jit_instrction_shape

* add log

* add flag in runtime/flags

* fix

* tix typo

* delete FLAGS_pir_apply_shape_optimization_pass

* delete symbolic shape pass in trt

* delete the test case of reshape and split op
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.

5 participants