Add support for slice_scatter; enable index_put (#3399)
Summary:
Summary of changes:
- support for scatter slice
- enable index put
With whole model delegation, I am seeing following crash in llama2:
```
in _verify_exported_program_signature
raise SpecViolationError(
torch._export.verifier.SpecViolationError: Buffer output getitem_1 does not point to a buffer that exists.
Dict of buffers that are mutated, in order: {'getitem_1': 'layers_0_attention_SDPA_kv_cache_k_cache', 'getitem': 'layers_0_attention_SDPA_kv_cache_v_cache', 'getitem_3': 'layers_1_attention_SDPA_kv_cache_k_cache', 'getitem_2': 'layers_1_attention_SDPA_kv_cache_v_cache', 'getitem_5': 'layers_2_attention_SDPA_kv_cache_k_cache', 'getitem_4': 'layers_2_attention_SDPA_kv_cache_v_cache', 'getitem_7': 'layers_3_attention_SDPA_kv_cache_k_cache', 'getitem_6': 'layers_3_attention_SDPA_kv_cache_v_cache', 'getitem_9': 'layers_4_attention_SDPA_kv_cache_k_cache', 'getitem_8': 'layers_4_attention_SDPA_kv_cache_v_cache'}
Buffer nodes available: []
```
Commands to lower llama2 to MPS:
- python -m examples.models.llama2.export_llama -kv --mps
- python3 -m examples.apple.mps.scripts.mps_example --model_name="llama2"
Pull Request resolved: https://github.com/pytorch/executorch/pull/3399
Reviewed By: shoumikhin
Differential Revision: D57293487
Pulled By: cccclai
fbshipit-source-id: a7ea392dc3c14b3538416b492d512aec71a0524e D
Denis Vieriu committed
ea9647f470cf2cd5bda2b034cbf9ae9896f37039
Parent: 4b5e434
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 5/13/2024, 9:23:59 PM