microsoft / onnxscript

ONNX Script enables developers to naturally author ONNX functions and models using a subset of Python.
https://onnxscript.ai/
MIT License
285 stars 54 forks source link

Add example for attributes in rewriter tutorial #1839

Closed gramalingam closed 2 months ago

gramalingam commented 2 months ago

Update documentation to illustrate the use of attributes in patterns. Fixed the auto-generated files manually. (Must experiment on how to instruct copilot to improve its first attempt.)


For more details, open the Copilot Workspace session.

codecov[bot] commented 2 months ago

:x: 19 Tests Failed:

Tests completed Failed Passed Skipped
12058 19 12039 2018
View the top 3 failed tests by shortest run time > > ``` > onnxscript.converter_test.TestConverter test_eager_op > ``` > >
Stack Traces | 0.001s run time > > > > > ``` > > No failure message available > > ``` > >
onnxscript.converter_test.TestConverter test_loops_break
Stack Traces | 0.001s run time > > ``` > No failure message available > ```
onnxscript.converter_test.TestConverter test_loops_while
Stack Traces | 0.001s run time > > ``` > No failure message available > ```

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

github-actions[bot] commented 2 months ago

Test Results

     24 files  ±  0      24 suites  ±0   2h 52m 20s :stopwatch: + 1m 46s  15 722 tests +144  13 342 :white_check_mark: +141    2 339 :zzz: +1   35 :x: +3   6 :fire:  - 1  354 859 runs  +  1  80 951 :white_check_mark:  -   2  273 651 :zzz: +1  215 :x: +3  42 :fire:  - 1 

For more details on these failures and errors, see this check.

Results for commit 76d9e42b. ± Comparison against base commit 74ae4cc0.

This pull request removes 2512 and adds 2656 tests. Note that renamed tests count towards both. ``` tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0002_attn_stable_diffusion_unet_0_attn_stable_diffusion_unet_0_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0003_ln_llama2_2_ln_llama2_2_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0004_attn_stable_diffusion_unet_without_encoder_hidden_states_1_attn_stable_diffusion_unet_without_encoder_hidden_states_1_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0005_geglu_stable_diffusion_unet_3_geglu_stable_diffusion_unet_3_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0006_geglu_stable_diffusion_unet_0_geglu_stable_diffusion_unet_0_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0008_attn_phi_1_5_0_attn_phi_1_5_0_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0009_geglu_stable_diffusion_unet_2_geglu_stable_diffusion_unet_2_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0010_gelu_phi_1_5_0_gelu_phi_1_5_0_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0011_attn_phi_1_5_1_attn_phi_1_5_1_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0012_gelu_phi_1_5_3_gelu_phi_1_5_3_onnx … ``` ``` tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0001_torchscript_model_torchscript_model_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0002_dynamo_Speech2Text2ForCausalLM_dynamo_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0003_dynamo_resnet18_dynamo_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0004_dynamo_mobilenetv2_100_dynamo_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0005_ln_llama2_1_ln_llama2_1_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0006_attn_phi_1_5_3_attn_phi_1_5_3_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0007_sdpa_llama2_3_sdpa_llama2_3_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0008_gelu_phi_1_5_3_gelu_phi_1_5_3_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0010_sdpa_llama2_0_sdpa_llama2_0_onnx tests.ir.serde_roundtrip_test.SerdeTest ‑ test_serialization_deserialization_produces_same_model_0011_attn_phi_1_5_2_attn_phi_1_5_2_onnx … ```
This pull request skips 1 test. ``` tests.function_libs.torch_lib.ops_test.TestOutputConsistencyEagerCPU ‑ test_output_match_opinfo__clamp_max_cpu_float16 ```

:recycle: This comment has been updated with latest results.