Skip to content

Comments

remove GPTDolomite#589

Closed
JamesKunstle wants to merge 1 commit intoinstructlab:mainfrom
JamesKunstle:remove-dolomite
Closed

remove GPTDolomite#589
JamesKunstle wants to merge 1 commit intoinstructlab:mainfrom
JamesKunstle:remove-dolomite

Conversation

@JamesKunstle
Copy link
Contributor

Dolomite has become a legacy performance and compatibility dependency required before Granite was upstreamed to Huggingface. For >=python3.12, Dolomite has been found to not work correctly. Therefore, we're dropping support.

@mergify
Copy link
Contributor

mergify bot commented Jun 3, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. @JamesKunstle please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added needs-rebase dependencies Pull requests that update a dependency file labels Jun 3, 2025
@mergify mergify bot added ci-failure and removed needs-rebase labels Jun 3, 2025
Dolomite has become a legacy performance and compatibility dependency
required before Granite was upstreamed to Huggingface. For >=python3.12,
Dolomite has been found to not work correctly. Therefore, we're dropping
support.

Signed-off-by: James Kunstle <jkunstle@redhat.com>
)

block_checkpointing(model, **kwargs)
# # this function is for supporting gradient checkpointing for padding free
Copy link
Contributor

Choose a reason for hiding this comment

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

remove?

default="HYBRID_SHARD",
help="Sharding strategy to be used for FSDP distributed training.",
)
parser.add_argument("--use_dolomite", action="store_true")
Copy link
Contributor

Choose a reason for hiding this comment

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

Above, I think we can remove

    if train_args.use_dolomite:
        command.append("--use_dolomite")

model,
lora_config,
args.distributed_training_framework,
gradient_checkpointing=not args.use_dolomite,
Copy link
Contributor

Choose a reason for hiding this comment

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

now that it's always True, I think you could do some code simplification in prepare_peft_model by removing the argument and hardcoding the True value inside the function.

)
args.lora_config = lora_config
elif not args.use_dolomite:
model.gradient_checkpointing_enable()
Copy link
Contributor

Choose a reason for hiding this comment

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

before the change, in case of lora_r > 0, we were not calling gradient_checkpointing_enable. Now we do. Is it an intentional change?

if train_args.use_dolomite and train_args.disable_flash_attn:
raise RuntimeError(
"ERROR: Trying to use dolomite padding-free transformer without flash attention is not supported"
if train_args.use_dolomite:
Copy link
Contributor

Choose a reason for hiding this comment

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


def check_flash_attn_enabled(disable_flash_attn: bool, use_dolomite: bool) -> bool:
def check_flash_attn_enabled(disable_flash_attn: bool) -> bool:
if not disable_flash_attn:
Copy link
Contributor

Choose a reason for hiding this comment

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

this code is now quite silly. :) how about

if disable_flash_attn:
    return False
if supports...():
    return True
raise ...

@booxter
Copy link
Contributor

booxter commented Jun 4, 2025

Not approving to clarify if we should indeed call gradient_checkpointing_enable for lora case. Otherwise, these are nits, feel free to ignore.

@mergify
Copy link
Contributor

mergify bot commented Jun 4, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. @JamesKunstle please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Jun 4, 2025
@booxter
Copy link
Contributor

booxter commented Jun 4, 2025

this will need a rebase after model class landed.

@JamesKunstle
Copy link
Contributor Author

Will re-open this PR based off of changes from #572

jrthms added a commit to jrthms/instructlab that referenced this pull request Jul 17, 2025
Fixes issue instructlab#3465
Deletes python 3.12 tests as since dolomite is being removed in 
instructlab/training#589

Signed-off-by: Jon Thomas <jrthms@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file needs-rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants