Skip to content

Set EXPERIMENTAL_1b_CHECKPOINT to True by default#840

Merged
jwilber merged 8 commits intomainfrom
jwilber/1665-ev2-brca1_nb-1b-use-bf16-ckpt
May 15, 2025
Merged

Set EXPERIMENTAL_1b_CHECKPOINT to True by default#840
jwilber merged 8 commits intomainfrom
jwilber/1665-ev2-brca1_nb-1b-use-bf16-ckpt

Conversation

@jwilber
Copy link
Collaborator

@jwilber jwilber commented Apr 21, 2025

Description

Sets EXPERIMENTAL_1b_CHECKPOINT to True by default, so that AUC scores are good.

Result for the new checkpoint are:

Data Fraction FP8 On FP8 Off
0.05 0.73 0.77
1 0.73 0.74

@jstjohn this still keeps our other checkpoint. We could also optionally change the cell to something like below if we want to hide the original 1b checkpoint, or even update our nemo2_evo2_1b_8k checkpoint to use the new one bf16 ckpt.

%%capture
MODEL_SIZE = "1b"  # also try 7b if you have a GPU with more than 32GB of memory

# Define checkpoint path
if MODEL_SIZE == "1b":
    from bionemo.core.data.load import load

    # Always use the fine-tuned BF16 checkpoint for 1b model
    checkpoint_path = load("evo2/1b-8k-bf16:1.0")
else:
    checkpoint_path = Path(f"nemo2_evo2_{MODEL_SIZE}_8k")

    # Check if the directory does not exist or is empty
    if not checkpoint_path.exists() or not any(checkpoint_path.iterdir()):
        !evo2_convert_to_nemo2 --model-path hf://arcinstitute/savanna_evo2_{MODEL_SIZE}_base --model-size {MODEL_SIZE} --output-dir nemo2_evo2_{MODEL_SIZE}_8k
    else:
        print("Checkpoint directory is not empty. Skipping command.")

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor
  • Documentation update
  • Other (please describe):

CI Pipeline Configuration

Configure CI behavior by applying the relevant labels:

Note

By default, the notebooks validation tests are skipped unless explicitly enabled.

Authorizing CI Runs

We use copy-pr-bot to manage authorization of CI
runs on NVIDIA's compute resources.

  • If a pull request is opened by a trusted user and contains only trusted changes, the pull request's code will
    automatically be copied to a pull-request/ prefixed branch in the source repository (e.g. pull-request/123)
  • If a pull request is opened by an untrusted user or contains untrusted changes, an NVIDIA org member must leave an
    /ok to test comment on the pull request to trigger CI. This will need to be done for each new commit.

Usage

TODO: Add code snippet

Pre-submit Checklist

  • I have tested these changes locally
  • I have updated the documentation accordingly
  • I have added/updated tests as needed
  • All existing tests pass successfully

Signed-off-by: Jared Wilber <jwilber@nvidia.com>
@copy-pr-bot
Copy link

copy-pr-bot bot commented Apr 21, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copy link
Collaborator

@jstjohn jstjohn left a comment

Choose a reason for hiding this comment

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

This is fine, if you have time maybe remove the if/else logic entirely and just show how to do it with this one fine-tuned checkpoint? Like it's not that experimental at this point. Seems to work pretty well.

…ottom table value

Signed-off-by: Jared Wilber <jwilber@nvidia.com>
Copy link
Collaborator

@farhadrgh farhadrgh left a comment

Choose a reason for hiding this comment

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

LGTM

@jwilber jwilber enabled auto-merge April 22, 2025 19:40
@jstjohn
Copy link
Collaborator

jstjohn commented May 12, 2025

/build-tests

@jwilber
Copy link
Collaborator Author

jwilber commented May 15, 2025

/ok to test 2d2f873

Signed-off-by: Jared Wilber <jwilber@nvidia.com>
@jwilber
Copy link
Collaborator Author

jwilber commented May 15, 2025

/ok to test 3bfebac

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.32%. Comparing base (dce2cb2) to head (3bfebac).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #840      +/-   ##
==========================================
- Coverage   84.35%   84.32%   -0.04%     
==========================================
  Files         139      139              
  Lines        8719     8719              
==========================================
- Hits         7355     7352       -3     
- Misses       1364     1367       +3     

see 1 file with indirect coverage changes

@jwilber jwilber added this pull request to the merge queue May 15, 2025
github-merge-queue bot pushed a commit that referenced this pull request May 15, 2025
### Description
Sets `EXPERIMENTAL_1b_CHECKPOINT` to True by default, so that AUC scores
are good.

Result for the new checkpoint are:

| Data Fraction | FP8 On | FP8 Off |
|---------------|--------|---------|
| 0.05          | 0.73   | 0.77    |
| 1              | 0.73   | 0.74    |


@jstjohn this still keeps our other checkpoint. We could also optionally
change the cell to something like below if we want to hide the original
1b checkpoint, or even update our `nemo2_evo2_1b_8k` checkpoint to use
the new one bf16 ckpt.




```python
%%capture
MODEL_SIZE = "1b"  # also try 7b if you have a GPU with more than 32GB of memory

# Define checkpoint path
if MODEL_SIZE == "1b":
    from bionemo.core.data.load import load

    # Always use the fine-tuned BF16 checkpoint for 1b model
    checkpoint_path = load("evo2/1b-8k-bf16:1.0")
else:
    checkpoint_path = Path(f"nemo2_evo2_{MODEL_SIZE}_8k")

    # Check if the directory does not exist or is empty
    if not checkpoint_path.exists() or not any(checkpoint_path.iterdir()):
        !evo2_convert_to_nemo2 --model-path hf://arcinstitute/savanna_evo2_{MODEL_SIZE}_base --model-size {MODEL_SIZE} --output-dir nemo2_evo2_{MODEL_SIZE}_8k
    else:
        print("Checkpoint directory is not empty. Skipping command.")
```


### Type of changes
<!-- Mark the relevant option with an [x] -->

- [x]  Bug fix (non-breaking change which fixes an issue)
- [ ]  New feature (non-breaking change which adds functionality)
- [ ]  Refactor
- [ ]  Documentation update
- [ ]  Other (please describe):

### CI Pipeline Configuration
Configure CI behavior by applying the relevant labels:

-
[SKIP_CI](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#skip_ci)
- Skip all continuous integration tests
-
[INCLUDE_NOTEBOOKS_TESTS](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#include_notebooks_tests)
- Execute notebook validation tests in pytest
-
[INCLUDE_SLOW_TESTS](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#include_slow_tests)
- Execute tests labelled as slow in pytest for extensive testing

> [!NOTE]
> By default, the notebooks validation tests are skipped unless
explicitly enabled.


#### Authorizing CI Runs

We use
[copy-pr-bot](https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/#automation)
to manage authorization of CI
runs on NVIDIA's compute resources.

* If a pull request is opened by a trusted user and contains only
trusted changes, the pull request's code will
automatically be copied to a pull-request/ prefixed branch in the source
repository (e.g. pull-request/123)
* If a pull request is opened by an untrusted user or contains untrusted
changes, an NVIDIA org member must leave an
`/ok to test` comment on the pull request to trigger CI. This will need
to be done for each new commit.

### Usage
<!--- How does a user interact with the changed code -->
```python
TODO: Add code snippet
```

### Pre-submit Checklist
<!--- Ensure all items are completed before submitting -->

 - [x] I have tested these changes locally
 - [x] I have updated the documentation accordingly
 - [x] I have added/updated tests as needed
 - [x] All existing tests pass successfully

---------

Signed-off-by: Jared Wilber <jwilber@nvidia.com>
Co-authored-by: John St. John <jstjohn@users.noreply.github.com>
Merged via the queue into main with commit 8007511 May 15, 2025
10 checks passed
@jwilber jwilber deleted the jwilber/1665-ev2-brca1_nb-1b-use-bf16-ckpt branch May 15, 2025 04:07
trvachov pushed a commit that referenced this pull request May 16, 2025
### Description
Sets `EXPERIMENTAL_1b_CHECKPOINT` to True by default, so that AUC scores
are good.

Result for the new checkpoint are:

| Data Fraction | FP8 On | FP8 Off |
|---------------|--------|---------|
| 0.05          | 0.73   | 0.77    |
| 1              | 0.73   | 0.74    |


@jstjohn this still keeps our other checkpoint. We could also optionally
change the cell to something like below if we want to hide the original
1b checkpoint, or even update our `nemo2_evo2_1b_8k` checkpoint to use
the new one bf16 ckpt.




```python
%%capture
MODEL_SIZE = "1b"  # also try 7b if you have a GPU with more than 32GB of memory

# Define checkpoint path
if MODEL_SIZE == "1b":
    from bionemo.core.data.load import load

    # Always use the fine-tuned BF16 checkpoint for 1b model
    checkpoint_path = load("evo2/1b-8k-bf16:1.0")
else:
    checkpoint_path = Path(f"nemo2_evo2_{MODEL_SIZE}_8k")

    # Check if the directory does not exist or is empty
    if not checkpoint_path.exists() or not any(checkpoint_path.iterdir()):
        !evo2_convert_to_nemo2 --model-path hf://arcinstitute/savanna_evo2_{MODEL_SIZE}_base --model-size {MODEL_SIZE} --output-dir nemo2_evo2_{MODEL_SIZE}_8k
    else:
        print("Checkpoint directory is not empty. Skipping command.")
```


### Type of changes
<!-- Mark the relevant option with an [x] -->

- [x]  Bug fix (non-breaking change which fixes an issue)
- [ ]  New feature (non-breaking change which adds functionality)
- [ ]  Refactor
- [ ]  Documentation update
- [ ]  Other (please describe):

### CI Pipeline Configuration
Configure CI behavior by applying the relevant labels:

-
[SKIP_CI](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#skip_ci)
- Skip all continuous integration tests
-
[INCLUDE_NOTEBOOKS_TESTS](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#include_notebooks_tests)
- Execute notebook validation tests in pytest
-
[INCLUDE_SLOW_TESTS](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#include_slow_tests)
- Execute tests labelled as slow in pytest for extensive testing

> [!NOTE]
> By default, the notebooks validation tests are skipped unless
explicitly enabled.


#### Authorizing CI Runs

We use
[copy-pr-bot](https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/#automation)
to manage authorization of CI
runs on NVIDIA's compute resources.

* If a pull request is opened by a trusted user and contains only
trusted changes, the pull request's code will
automatically be copied to a pull-request/ prefixed branch in the source
repository (e.g. pull-request/123)
* If a pull request is opened by an untrusted user or contains untrusted
changes, an NVIDIA org member must leave an
`/ok to test` comment on the pull request to trigger CI. This will need
to be done for each new commit.

### Usage
<!--- How does a user interact with the changed code -->
```python
TODO: Add code snippet
```

### Pre-submit Checklist
<!--- Ensure all items are completed before submitting -->

 - [x] I have tested these changes locally
 - [x] I have updated the documentation accordingly
 - [x] I have added/updated tests as needed
 - [x] All existing tests pass successfully

---------

Signed-off-by: Jared Wilber <jwilber@nvidia.com>
Co-authored-by: John St. John <jstjohn@users.noreply.github.com>
camirr-nv pushed a commit that referenced this pull request Jun 26, 2025
### Description
Sets `EXPERIMENTAL_1b_CHECKPOINT` to True by default, so that AUC scores
are good.

Result for the new checkpoint are:

| Data Fraction | FP8 On | FP8 Off |
|---------------|--------|---------|
| 0.05          | 0.73   | 0.77    |
| 1              | 0.73   | 0.74    |

@jstjohn this still keeps our other checkpoint. We could also optionally
change the cell to something like below if we want to hide the original
1b checkpoint, or even update our `nemo2_evo2_1b_8k` checkpoint to use
the new one bf16 ckpt.

```python
%%capture
MODEL_SIZE = "1b"  # also try 7b if you have a GPU with more than 32GB of memory

# Define checkpoint path
if MODEL_SIZE == "1b":
    from bionemo.core.data.load import load

    # Always use the fine-tuned BF16 checkpoint for 1b model
    checkpoint_path = load("evo2/1b-8k-bf16:1.0")
else:
    checkpoint_path = Path(f"nemo2_evo2_{MODEL_SIZE}_8k")

    # Check if the directory does not exist or is empty
    if not checkpoint_path.exists() or not any(checkpoint_path.iterdir()):
        !evo2_convert_to_nemo2 --model-path hf://arcinstitute/savanna_evo2_{MODEL_SIZE}_base --model-size {MODEL_SIZE} --output-dir nemo2_evo2_{MODEL_SIZE}_8k
    else:
        print("Checkpoint directory is not empty. Skipping command.")
```

### Type of changes
<!-- Mark the relevant option with an [x] -->

- [x]  Bug fix (non-breaking change which fixes an issue)
- [ ]  New feature (non-breaking change which adds functionality)
- [ ]  Refactor
- [ ]  Documentation update
- [ ]  Other (please describe):

### CI Pipeline Configuration
Configure CI behavior by applying the relevant labels:

-
[SKIP_CI](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#skip_ci)
- Skip all continuous integration tests
-
[INCLUDE_NOTEBOOKS_TESTS](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#include_notebooks_tests)
- Execute notebook validation tests in pytest
-
[INCLUDE_SLOW_TESTS](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#include_slow_tests)
- Execute tests labelled as slow in pytest for extensive testing

> [!NOTE]
> By default, the notebooks validation tests are skipped unless
explicitly enabled.

#### Authorizing CI Runs

We use
[copy-pr-bot](https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/#automation)
to manage authorization of CI
runs on NVIDIA's compute resources.

* If a pull request is opened by a trusted user and contains only
trusted changes, the pull request's code will
automatically be copied to a pull-request/ prefixed branch in the source
repository (e.g. pull-request/123)
* If a pull request is opened by an untrusted user or contains untrusted
changes, an NVIDIA org member must leave an
`/ok to test` comment on the pull request to trigger CI. This will need
to be done for each new commit.

### Usage
<!--- How does a user interact with the changed code -->
```python
TODO: Add code snippet
```

### Pre-submit Checklist
<!--- Ensure all items are completed before submitting -->

 - [x] I have tested these changes locally
 - [x] I have updated the documentation accordingly
 - [x] I have added/updated tests as needed
 - [x] All existing tests pass successfully

---------

Signed-off-by: Jared Wilber <jwilber@nvidia.com>
Co-authored-by: John St. John <jstjohn@users.noreply.github.com>
Signed-off-by: Ubuntu <camirr@nvidia.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.

4 participants