Skip to content

Feature/vlm finetune - #13

Merged
Rouzbehat78 merged 32 commits into
mainfrom
feature/vlm-finetune
Mar 24, 2026
Merged

Feature/vlm finetune#13
Rouzbehat78 merged 32 commits into
mainfrom
feature/vlm-finetune

Conversation

@Rouzbehat78

@Rouzbehat78 Rouzbehat78 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces several enhancements and improvements to the leap-finetune training pipeline, with a focus on evaluation benchmarks, dataset loading robustness, and documentation clarity. The most significant changes are the addition of automatic evaluation benchmarks during training, improved support for loading datasets from directories of Parquet files, and expanded documentation for both users and developers.
Bug FIX
Bug fixed for per trainer batch size was automatically initalized by HF Trainer self._trainer_batch_size to number of GPUs => fixed now reads the batchsize from configs and global/local steps calculation is being done correclty.

Evaluation Benchmarks Integration

  • Added a comprehensive evaluation benchmark system, including new files: README.md, base.py, callback.py, and an updated __init__.py, enabling automatic benchmark evaluation during training with distributed all-reduce and wandb logging. [1] [2] [3] [4]
  • Benchmarks are configured via YAML, support multiple metrics (e.g., short_answer, logprob_zero_shot, mcq_gen and etc), and are fully integrated with HuggingFace Trainer callbacks.

** Resumption of Training **

  • Added support for reusming the training from where it stopped and resuming from any checkpoint path or latest, while preserving the wandb run ID and optimizer states and etc.

Dataset Loading Robustness

  • Improved dataset loading logic to support directories containing multiple Parquet files, both in the main loader and in schema validation utilities. This ensures seamless handling of sharded datasets for both training and evaluation. [1] [2] [3]
  • Enhanced schema validation and sample loading to auto-detect and correctly process directories of Parquet shards.

Documentation and Usability

  • extended the README and created a README under evaluation/ dir for instructions on how to add custom dataset, metric for the Eval hook.

@Rouzbehat78 Rouzbehat78 changed the title Feature/vlm finetune [WIP] Feature/vlm finetune Mar 5, 2026
@Rouzbehat78
Rouzbehat78 force-pushed the feature/vlm-finetune branch from 4c54c4b to 558446f Compare March 9, 2026 15:28
@Rouzbehat78 Rouzbehat78 changed the title [WIP] Feature/vlm finetune Feature/vlm finetune Mar 12, 2026
@Rouzbehat78
Rouzbehat78 requested a review from alay2shah March 12, 2026 19:46
@Rouzbehat78
Rouzbehat78 force-pushed the feature/vlm-finetune branch from 0d29037 to b94aa98 Compare March 23, 2026 18:16
…o a python parsed list. Validate_loader will calidate the schema after preporcessing on sample rows, differnet pre-processsing can be added and functions are callable from the config.yaml
…s to run full eval on various benchmarks and log into wand to track progress and catastrophic forgetting
…ame functionality to convert and parse json strings and align with expected HF schema
…to run full eval/benchmark on the eval dataset with their metrics
…t or latest that resolves to last run latest checkppoint
@Rouzbehat78
Rouzbehat78 force-pushed the feature/vlm-finetune branch from 32c566d to e4f9902 Compare March 23, 2026 23:24
Rouzbehat78 and others added 8 commits March 24, 2026 00:16
…nchmarks

Move count += 1 inside try block so failed samples are excluded from
the denominator. Change hardcoded "cuda" to device.type in VLM autocast
to match LLM benchmarks.
Use self.args.per_device_train_batch_size instead of
self._train_batch_size which HF Trainer auto-multiplies by world_size,
causing double-sharding with Ray.
Eliminates 4 identical evaluate() loops across benchmark subclasses.
Subclasses now only implement load_samples() and score_sample().
…r on missing metric

Use **kwargs consistently for both logprob and generation paths.
Replace vestigial "type" with "metric" in _FACTORY_KEYS. Raise
ValueError on missing or unknown metric instead of silently skipping.
Remove redundant image_root double-handling in VLM factory.
… logger

Remove file-level docstrings from all evaluation module files. Convert
logger.info(f"...") to %s style in training loops and trainer_mixins.
Replace print() with logger.warning() in config_parser. Fix section
header style to use === convention.
Test eval data loaders (format detection, JSONL/JSON loading, limit,
normalization, legacy format conversion). Test benchmark base class
(failure exclusion, sample caching). Test benchmark config passthrough
in YAML parsing.

@alay2shah alay2shah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@Rouzbehat78
Rouzbehat78 merged commit cb06430 into main Mar 24, 2026
1 check passed
@Rouzbehat78
Rouzbehat78 deleted the feature/vlm-finetune branch March 24, 2026 16:39
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.

2 participants