You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit db7c0ca
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix: genai_config defaults and tokenizer copy for --config mode (#153)
## Summary
Addresses Issues 5 and 6 from Edge LLM evaluation.
### Issue 5: `past_present_share_buffer` defaults
- **`do_sample`**: Changed from `False` to `True` to match production
reference configs (e.g.
`testdata/qwen2_5_genai_config/genai_config.json`)
- **`max_length`**: Changed from hardcoded `4096` to `context_length`
(derived from the model's `max_position_embeddings`)
- **`past_present_share_buffer`**: Set to `True` for WebGPU EP — the
WebGPU runtime allocates a fixed KV-cache buffer up-front and requires
past/present tensors to share backing memory
### Issue 6: Tokenizer files not copied with `--config`
- Added `_copy_tokenizer_files_from_local(source_dir, output_dir)` that
copies tokenizer files from a local directory
- `write_ort_genai_config()` gains a `local_config_path` parameter; when
`hf_model_id` is `None` and `local_config_path` is set, tokenizer files
are copied from the local directory
- `_save_package()` in the CLI now passes `args.config` as
`local_config_path`
- Updated `--runtime` help text to document both modes
### Tests
- Updated `genai_config_test.py`: fixed `do_sample` assertion, added
WebGPU/CUDA tests for `past_present_share_buffer` and `max_length`
- Added `TestCopyTokenizerFilesFromLocal` and
`TestWriteOrtGenaiConfigLocalPath` test classes to `auto_export_test.py`
All 2419 tests pass.
---------
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Justin Chu <[email protected]>
0 commit comments