Skip to content

Support llama3.1-8b-Instruct in to_huggingface#3852

Merged
copybara-service[bot] merged 1 commit intomainfrom
hengtaoguo-fix
May 8, 2026
Merged

Support llama3.1-8b-Instruct in to_huggingface#3852
copybara-service[bot] merged 1 commit intomainfrom
hengtaoguo-fix

Conversation

@hengtaoguo
Copy link
Copy Markdown
Collaborator

@hengtaoguo hengtaoguo commented May 8, 2026

Description

Complete llama3.1-8b-Instruct to_huggingface conversion, by using the base model's mapping information.

Static Assets: Specialized assets (the Instruct tokenizer, tokenizer.json, and templates) continue to be downloaded and saved correctly via tokenizer.save_pretrained using the -Instruct Hub ID.

Fixes: b/510847180

Tests

Checkpoint conversion:

python -m maxtext.checkpoint_conversion.to_huggingface model_name=llama3.1-8b-Instruct load_parameters_path=gs://hengtaoguo-maxtext-logs/checkpoints/llama3.1-8b-Instruct/scanned/2026-05-08/0/items base_output_directory=/dev/shm/hengtaoguo/hf_safetensor/llama3.1-8b-Instruct scan_layers=true weight_dtype=bfloat16 hardware=cpu skip_jax_distributed_system=True hf_access_token=<your_token>

Forward pass logit check:

python -m tests.utils.forward_pass_logit_checker maxtext/configs/base.yml run_name=ht_test model_name=llama3.1-8b tokenizer_path=meta-llama/Llama-3.1-8B-Instruct load_parameters_path=gs://hengtaoguo-maxtext-logs/checkpoints/llama3.1-8b-Instruct/scanned/2026-05-08/0/items max_prefill_predict_length=4 hf_access_token=<your_token> --run_hf_model=True --hf_model_path=meta-llama/Llama-3.1-8B-Instruct --max_kl_div=0.015

Logs

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@hengtaoguo hengtaoguo changed the title Support -Instruct models on to_huggingface Support -Instruct models in to_huggingface May 8, 2026
@hengtaoguo hengtaoguo force-pushed the hengtaoguo-fix branch 4 times, most recently from d807d0b to 352288f Compare May 8, 2026 21:05
@hengtaoguo hengtaoguo changed the title Support -Instruct models in to_huggingface Support llama3.1-8b-Instruct in to_huggingface May 8, 2026
@hengtaoguo hengtaoguo marked this pull request as ready for review May 8, 2026 21:08
@copybara-service copybara-service Bot merged commit 1a435bd into main May 8, 2026
48 checks passed
@copybara-service copybara-service Bot deleted the hengtaoguo-fix branch May 8, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants