Skip to content

Parameterize trust_remote_code for quark_visitai#2575

Open
shaahji wants to merge 2 commits into
mainfrom
shaahji/msrc126710
Open

Parameterize trust_remote_code for quark_visitai#2575
shaahji wants to merge 2 commits into
mainfrom
shaahji/msrc126710

Conversation

@shaahji

@shaahji shaahji commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Parameterize trust_remote_code for quark_visitai

trust_remote_code was being defaulted to True raising security concerns. Replacing the default with user driven value thru' the config.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

(Optional) Issue link

trust_remote_code was being defaulted to True raising security concerns.
Replacing the default with user driven value thru' the config.
Copilot AI review requested due to automatic review settings July 16, 2026 22:02
@shaahji
shaahji enabled auto-merge (squash) July 16, 2026 22:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes Quark Vitis AI quantization safer by removing hard-coded trust_remote_code=True in Hugging Face model/tokenizer loading and instead deriving the value from user configuration (pass config and/or the model handler load kwargs).

Changes:

  • Add trust_remote_code parameters to Quark Vitis AI LLM model/tokenizer preparation helpers and propagate into from_pretrained(...).
  • Introduce a trust_remote_code pass config knob in QuarkQuantizationVitisAI and plumb the resolved value into the torch quantization runner.
  • Update the quantization runner to pass trust_remote_code through to model/tokenizer loading.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
olive/passes/quark_vitisai/torch/language_modeling/llm_utils/model_preparation.py Parameterizes trust_remote_code for tokenizer/model loads (and tokenizer re-load in save_model) instead of forcing True.
olive/passes/quark_vitisai/torch/language_modeling/llm_ptq/quantize_quark.py Threads trust_remote_code into get_model/get_tokenizer calls used by Quark torch quantization.
olive/passes/quark_vitisai/quark_quantization_vitisai.py Adds pass-level trust_remote_code config and resolves it from model load kwargs with an explicit override path.

Comment thread olive/passes/quark_vitisai/torch/language_modeling/llm_ptq/quantize_quark.py Outdated
Comment thread olive/passes/quark_vitisai/quark_quantization_vitisai.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants