Skip to content

feat: migrate pipeline to nnx#2885

Open
mesakhcienet wants to merge 2 commits intoAI-Hypercomputer:mainfrom
CIeNET-International:test/pipeline-scan-nnx
Open

feat: migrate pipeline to nnx#2885
mesakhcienet wants to merge 2 commits intoAI-Hypercomputer:mainfrom
CIeNET-International:test/pipeline-scan-nnx

Conversation

@mesakhcienet
Copy link
Contributor

@mesakhcienet mesakhcienet commented Dec 24, 2025

Description

implement nnx-based pipeline.

This PR extends PR#2831

Main changes:

  1. nnx_decoders.py: implementing the missing pipeline logic in nnx_decoders.py.
  2. pipeline.py : add a new class NNXPipeline, which is a nnx-based pipeline class.

Tests

we run the pipeline process with command below:

MODEL_NAME=llama2-7b
python -m MaxText.train src/maxtext/configs/base.yml \
    run_name=pipeline_test_${MODEL_NAME}_nnx \
    base_output_directory=/dev/shm/pipeline_test_nnx \
    model_name=${MODEL_NAME}\
    dataset_type=synthetic \
    steps=15 \
    debug_sharding=true \
    per_device_batch_size=2 \
    max_target_length=32 \
    ici_pipeline_parallelism=2 \
    num_pipeline_microbatches=4 \
    num_layers_per_pipeline_stage=2 \
    enable_checkpointing=false \
    enable_nnx=true \
    pure_nnx_decoder=true \
    scan_layers_per_stage=false \
    async_checkpointing=false > nnx-porting-log/pipeline/custom_${MODEL_NAME}.log 2>&1

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.

@mesakhcienet mesakhcienet changed the title core: migrate pipeline to nnx feat: migrate pipeline to nnx Dec 24, 2025
@mesakhcienet mesakhcienet force-pushed the test/pipeline-scan-nnx branch 8 times, most recently from 6875da8 to f34b1a3 Compare January 15, 2026 23:43
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 50.77720% with 95 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/MaxText/layers/pipeline.py 49.73% 82 Missing and 13 partials ⚠️

📢 Thoughts on this report? Let us know!

@mesakhcienet mesakhcienet force-pushed the test/pipeline-scan-nnx branch 4 times, most recently from 12a3907 to 2c16599 Compare January 28, 2026 08:04
@mesakhcienet mesakhcienet force-pushed the test/pipeline-scan-nnx branch 2 times, most recently from 64dc147 to 9e4518e Compare February 2, 2026 01:58
@mesakhcienet mesakhcienet force-pushed the test/pipeline-scan-nnx branch from 631a73e to ac97a1d Compare March 2, 2026 08:48
@mesakhcienet mesakhcienet changed the base branch from main to xibin/nnx_all March 2, 2026 08:48
@ecnal-cienet ecnal-cienet force-pushed the xibin/nnx_all branch 12 times, most recently from 1849f0b to 669dc01 Compare March 3, 2026 19:59
@mesakhcienet mesakhcienet force-pushed the test/pipeline-scan-nnx branch 2 times, most recently from 8883076 to 2e46721 Compare March 5, 2026 01:37
Copy link
Collaborator

@charlesli640 charlesli640 left a comment

Choose a reason for hiding this comment

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

  1. do code format clean up
  2. run pre-commit checking
  3. Don't make unnecessary changes, maybe introduced from rebase and incorrect conflict solving.

@ecnal-cienet ecnal-cienet force-pushed the xibin/nnx_all branch 14 times, most recently from 2d742f9 to fc3fe0b Compare March 7, 2026 04:00
@mesakhcienet mesakhcienet force-pushed the test/pipeline-scan-nnx branch from 2e46721 to b732cb3 Compare March 9, 2026 01:24
@mesakhcienet mesakhcienet changed the base branch from xibin/nnx_all to main March 9, 2026 01:25
@mesakhcienet mesakhcienet force-pushed the test/pipeline-scan-nnx branch 5 times, most recently from 34d16bc to c715fcd Compare March 10, 2026 01:40
    Adding nnx_decoders.py in parallel with decoders.py

    1. Dup and modifiy decoders.py on new file nnx_decoders.py
    2. add new config pure_nnx_decoder to control if model will use NNXDecoder, default false for now
    3. modify relative code to accomodate the change
    4. add/modify unit test
@mesakhcienet mesakhcienet force-pushed the test/pipeline-scan-nnx branch 3 times, most recently from 618de58 to e7656b2 Compare March 11, 2026 06:29
1. Update nnx_decoders.py, enable pipeline support in nnx_decoders.py.
2. Add NNX-based  pipeline into pipeline.py.
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.

3 participants