-
Notifications
You must be signed in to change notification settings - Fork 491
feat: MLFlow Integration for experiment tracking #534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
therealnaveenkamal
wants to merge
12
commits into
NVIDIA-NeMo:main
from
therealnaveenkamal:feature/ml-flow-logger
Closed
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
890fdc5
Feat: MLFlow Integration for experiment tracking
therealnaveenkamal 70e6102
code structuring, cleanup and readme update
therealnaveenkamal 4bd8e51
code cleanup and structure
therealnaveenkamal ea8fe0f
code cleanup
therealnaveenkamal 47fc68c
minor readme chaange
therealnaveenkamal 2cf0cf0
minor mlflow config updates
therealnaveenkamal 9064a45
minor lint fix
therealnaveenkamal e37ab51
Merge branch 'main' into feature/ml-flow-logger
therealnaveenkamal caed641
fixed lint error
therealnaveenkamal b864de9
Merge upstream/main: resolve conflicts and integrate MLflow logger
therealnaveenkamal 90bec34
update uv.lock to account for the new dependency
terrykong af4bb13
Merge pull request #1 from NVIDIA-NeMo/tk/uvlock-mlflow
therealnaveenkamal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
therealnaveenkamal marked this conversation as resolved.
Outdated
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| # SFT Algorithm Configuration with MLflow logging | ||
| sft: | ||
|
therealnaveenkamal marked this conversation as resolved.
Outdated
|
||
| ## total number of steps to train will equal | ||
| ## min((max_num_epochs * len(train_dataloader)), max_num_steps) | ||
| max_num_epochs: 1 | ||
| max_num_steps: 60 | ||
|
|
||
| val_period: 10 | ||
| val_batches: 8 | ||
| val_global_batch_size: 32 | ||
| val_micro_batch_size: 1 | ||
| val_at_start: true | ||
| seed: 42 | ||
|
|
||
| checkpointing: | ||
| enabled: true | ||
| checkpoint_dir: "results/sft" | ||
| metric_name: "val_loss" | ||
| higher_is_better: false | ||
| keep_top_k: 3 | ||
| save_period: 10 | ||
|
|
||
| policy: | ||
| model_name: "meta-llama/Llama-3.2-1B" | ||
| tokenizer: | ||
| name: ${policy.model_name} ## specify if you'd like to use a tokenizer different from the model's default | ||
| chat_template: "{% for message in messages %}{%- if message['role'] == 'system' %}{{'Context: ' + message['content'].strip()}}{%- elif message['role'] == 'user' %}{{' Question: ' + message['content'].strip() + ' Answer:'}}{%- elif message['role'] == 'assistant' %}{{' ' + message['content'].strip()}}{%- endif %}{% endfor %}" | ||
| train_global_batch_size: 32 | ||
| train_micro_batch_size: 1 | ||
| max_total_sequence_length: 1024 | ||
| precision: "bfloat16" | ||
| fsdp_offload_enabled: false | ||
| activation_checkpointing_enabled: false | ||
|
|
||
| dtensor_cfg: | ||
| enabled: true | ||
| cpu_offload: False | ||
| sequence_parallel: false | ||
| activation_checkpointing: false | ||
| tensor_parallel_size: 1 | ||
| context_parallel_size: 1 | ||
| custom_parallel_plan: null | ||
|
|
||
| dynamic_batching: | ||
| enabled: false | ||
|
|
||
| # makes the training sequence length divisible by the tensor parallel size | ||
| # this is useful for sequence parallel training | ||
| make_sequence_length_divisible_by: ${policy.dtensor_cfg.tensor_parallel_size} | ||
| max_grad_norm: 1.0 | ||
|
|
||
| optimizer: | ||
| name: "torch.optim.AdamW" | ||
| kwargs: | ||
| lr: 5.0e-6 | ||
| weight_decay: 0.1 | ||
| betas: [0.9, 0.98] | ||
| eps: 1e-5 | ||
| # when using Dtensor, we need to set foreach | ||
| # and fused to False | ||
| foreach: False | ||
| fused: False | ||
|
|
||
| ## ignored since enabled=false, but needed for testing purposes | ||
| megatron_cfg: | ||
| enabled: false | ||
| empty_unused_memory_level: 1 | ||
| activation_checkpointing: false | ||
| tensor_model_parallel_size: 2 | ||
| pipeline_model_parallel_size: 2 | ||
| context_parallel_size: 1 | ||
| pipeline_dtype: ${policy.precision} | ||
| num_layers_in_first_pipeline_stage: null | ||
| num_layers_in_last_pipeline_stage: null | ||
| sequence_parallel: false | ||
|
|
||
| optimizer: | ||
| optimizer: "adam" | ||
| lr: 5.0e-6 | ||
| min_lr: 4.9999e-6 | ||
| weight_decay: 0.1 | ||
| bf16: false | ||
| fp16: false | ||
| params_dtype: "float32" | ||
|
|
||
| #adam | ||
| adam_beta1: 0.9 | ||
| adam_beta2: 0.98 | ||
| adam_eps: 1e-5 | ||
|
|
||
| #sgd | ||
| sgd_momentum: 0.9 | ||
|
|
||
| #distributed optimizer | ||
| use_distributed_optimizer: true | ||
| use_precision_aware_optimizer: true | ||
|
|
||
| clip_grad: ${policy.max_grad_norm} | ||
|
|
||
| scheduler: | ||
| start_weight_decay: ${policy.megatron_cfg.optimizer.weight_decay} | ||
| end_weight_decay: ${policy.megatron_cfg.optimizer.weight_decay} | ||
| weight_decay_incr_style: "constant" | ||
| lr_decay_style: "constant" | ||
| lr_decay_iters: null | ||
| lr_warmup_iters: 50 | ||
| lr_warmup_init: 4.9999e-6 | ||
|
|
||
| distributed_data_parallel_config: | ||
| grad_reduce_in_fp32: false | ||
| overlap_grad_reduce: true | ||
| overlap_param_gather: false | ||
| average_in_collective: true | ||
| data_parallel_sharding_strategy: "optim_grads_params" | ||
|
|
||
| data: | ||
| max_input_seq_length: ${policy.max_total_sequence_length} | ||
| dataset_name: "squad" | ||
| add_bos: true | ||
| add_eos: true | ||
| add_generation_prompt: false | ||
|
|
||
| logger: | ||
| log_dir: "logs" # Base directory for all logs | ||
| wandb_enabled: false # Disable wandb for this example | ||
| tensorboard_enabled: true # Keep tensorboard for comparison | ||
| mlflow_enabled: true # Enable MLflow logging | ||
| monitor_gpus: true | ||
| tensorboard: | ||
| log_dir: "tb_logs-sft-dev-${data.dataset_name}" | ||
| mlflow: | ||
| experiment_name: "nemo-rl-sft-experiment" | ||
| run_name: "sft-${data.dataset_name}-${policy.optimizer.kwargs.lr}" | ||
| tracking_uri: null # Use local MLflow tracking server (default) | ||
| artifact_location: null # Use default artifact location | ||
| gpu_monitoring: | ||
| collection_interval: 10 # How often to collect GPU usage metrics (in seconds) | ||
| flush_interval: 10 # How often to flush GPU usage metrics to the loggers (in seconds) | ||
|
|
||
| cluster: | ||
| gpus_per_node: 1 | ||
| num_nodes: 1 | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.