Skip to content
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

add Llava-SGlang #54

Merged
merged 3 commits into from
Apr 18, 2024
Merged

add Llava-SGlang #54

merged 3 commits into from
Apr 18, 2024

Conversation

jzhang38
Copy link
Contributor

Add llava_sglang.

Some caveats:

  1. sglang currently only supports single-image input. We use the first image by default.
  2. there is no concept of batch size in sglang. We use "parallel" instead.
  3. use python -m instead of accelerate
  4. sglang only supports tensor parallel (tp_size). It does not support data parallel

example eval config and script:

- model: llava_sglang
  model_args: pretrained=liuhaotian/llava-v1.6-34b,tokenizer=liuhaotian/llava-v1.6-34b-tokenizer,conv_template=chatml,tp_size=8,parallel=4
  tasks: mme
  batch_size: 1
  log_samples: true
  log_samples_suffix: eval_mme 
  output_path: "./logs/"
python -m lmms_eval --config config.yaml 

@Luodian
Copy link
Contributor

Luodian commented Apr 12, 2024

Thanks! This is a great feature enabling inference for larger models.

However, can you put a result screenshot or do more test to see if the results could match?

@Luodian
Copy link
Contributor

Luodian commented Apr 14, 2024

Hi @jzhang38 🦦

@jzhang38
Copy link
Contributor Author

jzhang38 commented Apr 15, 2024

1.5 7B:

- model: llava_sglang
  model_args: pretrained=liuhaotian/llava-v1.5-7b
  tasks: mme,ai2d,scienceqa_img
  batch_size: 1
  log_samples: true
  log_samples_suffix: eval_mme 
  output_path: "./logs/"
Tasks Version Filter n-shot Metric Value Stderr
mme Yaml none 0 mme_cognition_score 352.5000 ± N/A
none 0 mme_percetion_score 1511.3936 ± N/A
ai2d Yaml none 0 exact_match 55.6023 ± 0.0089
scienceqa_img Yaml none 0 exact_match 69.5092 ± 0.0103

Match pretty closely

@jzhang38
Copy link
Contributor Author

1.5 13B:

- model: llava_sglang
  model_args: pretrained=liuhaotian/llava-v1.5-13b
  tasks: mme,ai2d,scienceqa_img
  batch_size: 1
  log_samples: true
  log_samples_suffix: eval_mme 
  output_path: "./logs/"
Tasks Version Filter n-shot Metric Value Stderr
ai2d Yaml none 0 exact_match 59.1645 ± 0.0088
mme Yaml none 0 mme_cognition_score 295.0000 ± N/A
none 0 mme_percetion_score 1523.5189 ± N/A
scienceqa_img Yaml none 0 exact_match 72.8309 ± 0.0099

Luodian added a commit that referenced this pull request Apr 16, 2024
* [Fix] rearrange location of init eval_logger

* Ignore DeprecationWarnings in lmms_eval/__main__.py and lmms_eval/models/fuyu.py

* Update lmms_eval/__main__.py and lmms_eval/utils.py

* update

* Update llava.py with LLaVA model imports and error handling

* Add and test new datasets

* update

* Update wandb version and require report-editing:v0

* Add support for logging samples to Weights and Biases

This commit adds a new command-line argument `--wandb_log_samples` to enable logging all model outputs and documents for per-sample measurement and post-hoc analysis to Weights and Biases. The `cli_evaluate` function has been modified to handle this new argument and log the samples if the argument is set to True. The `wandb_logger` object has also been updated to include a new method `log_eval_samples` for logging the samples. This enhancement improves the functionality of the LMMS evaluation tool.

* update
Luodian added a commit that referenced this pull request Apr 16, 2024
* [Fix] rearrange location of init eval_logger

* Ignore DeprecationWarnings in lmms_eval/__main__.py and lmms_eval/models/fuyu.py

* Update lmms_eval/__main__.py and lmms_eval/utils.py

* update

* Update llava.py with LLaVA model imports and error handling

* Add and test new datasets

* update

* Update wandb version and require report-editing:v0

* Add support for logging samples to Weights and Biases

This commit adds a new command-line argument `--wandb_log_samples` to enable logging all model outputs and documents for per-sample measurement and post-hoc analysis to Weights and Biases. The `cli_evaluate` function has been modified to handle this new argument and log the samples if the argument is set to True. The `wandb_logger` object has also been updated to include a new method `log_eval_samples` for logging the samples. This enhancement improves the functionality of the LMMS evaluation tool.

* update
@jzhang38
Copy link
Contributor Author

@Luodian

@Luodian Luodian merged commit 95df9fe into main Apr 18, 2024
2 checks passed
@Luodian Luodian deleted the add_llava_sglang branch June 12, 2024 15:51
kangreen0210 pushed a commit to kangreen0210/LIME that referenced this pull request Oct 6, 2024
* [Fix] rearrange location of init eval_logger

* Ignore DeprecationWarnings in lmms_eval/__main__.py and lmms_eval/models/fuyu.py

* Update lmms_eval/__main__.py and lmms_eval/utils.py

* update

* Update llava.py with LLaVA model imports and error handling

* Add and test new datasets

* update

* Update wandb version and require report-editing:v0

* Add support for logging samples to Weights and Biases

This commit adds a new command-line argument `--wandb_log_samples` to enable logging all model outputs and documents for per-sample measurement and post-hoc analysis to Weights and Biases. The `cli_evaluate` function has been modified to handle this new argument and log the samples if the argument is set to True. The `wandb_logger` object has also been updated to include a new method `log_eval_samples` for logging the samples. This enhancement improves the functionality of the LMMS evaluation tool.

* update
kangreen0210 pushed a commit to kangreen0210/LIME that referenced this pull request Oct 6, 2024
* [Fix] rearrange location of init eval_logger

* Ignore DeprecationWarnings in lmms_eval/__main__.py and lmms_eval/models/fuyu.py

* Update lmms_eval/__main__.py and lmms_eval/utils.py

* update

* Update llava.py with LLaVA model imports and error handling

* Add and test new datasets

* update

* Update wandb version and require report-editing:v0

* Add support for logging samples to Weights and Biases

This commit adds a new command-line argument `--wandb_log_samples` to enable logging all model outputs and documents for per-sample measurement and post-hoc analysis to Weights and Biases. The `cli_evaluate` function has been modified to handle this new argument and log the samples if the argument is set to True. The `wandb_logger` object has also been updated to include a new method `log_eval_samples` for logging the samples. This enhancement improves the functionality of the LMMS evaluation tool.

* update
kangreen0210 pushed a commit to kangreen0210/LIME that referenced this pull request Oct 6, 2024
* [Fix] rearrange location of init eval_logger

* Ignore DeprecationWarnings in lmms_eval/__main__.py and lmms_eval/models/fuyu.py

* Update lmms_eval/__main__.py and lmms_eval/utils.py

* update

* Update llava.py with LLaVA model imports and error handling

* Add and test new datasets

* update

* Update wandb version and require report-editing:v0

* Add support for logging samples to Weights and Biases

This commit adds a new command-line argument `--wandb_log_samples` to enable logging all model outputs and documents for per-sample measurement and post-hoc analysis to Weights and Biases. The `cli_evaluate` function has been modified to handle this new argument and log the samples if the argument is set to True. The `wandb_logger` object has also been updated to include a new method `log_eval_samples` for logging the samples. This enhancement improves the functionality of the LMMS evaluation tool.

* update
kangreen0210 pushed a commit to kangreen0210/LIME that referenced this pull request Oct 6, 2024
* [Fix] rearrange location of init eval_logger

* Ignore DeprecationWarnings in lmms_eval/__main__.py and lmms_eval/models/fuyu.py

* Update lmms_eval/__main__.py and lmms_eval/utils.py

* update

* Update llava.py with LLaVA model imports and error handling

* Add and test new datasets

* update

* Update wandb version and require report-editing:v0

* Add support for logging samples to Weights and Biases

This commit adds a new command-line argument `--wandb_log_samples` to enable logging all model outputs and documents for per-sample measurement and post-hoc analysis to Weights and Biases. The `cli_evaluate` function has been modified to handle this new argument and log the samples if the argument is set to True. The `wandb_logger` object has also been updated to include a new method `log_eval_samples` for logging the samples. This enhancement improves the functionality of the LMMS evaluation tool.

* update
kangreen0210 pushed a commit to kangreen0210/LIME that referenced this pull request Oct 6, 2024
* [Fix] rearrange location of init eval_logger

* Ignore DeprecationWarnings in lmms_eval/__main__.py and lmms_eval/models/fuyu.py

* Update lmms_eval/__main__.py and lmms_eval/utils.py

* update

* Update llava.py with LLaVA model imports and error handling

* Add and test new datasets

* update

* Update wandb version and require report-editing:v0

* Add support for logging samples to Weights and Biases

This commit adds a new command-line argument `--wandb_log_samples` to enable logging all model outputs and documents for per-sample measurement and post-hoc analysis to Weights and Biases. The `cli_evaluate` function has been modified to handle this new argument and log the samples if the argument is set to True. The `wandb_logger` object has also been updated to include a new method `log_eval_samples` for logging the samples. This enhancement improves the functionality of the LMMS evaluation tool.

* update
kangreen0210 pushed a commit to kangreen0210/LIME that referenced this pull request Oct 6, 2024
* [Fix] rearrange location of init eval_logger

* Ignore DeprecationWarnings in lmms_eval/__main__.py and lmms_eval/models/fuyu.py

* Update lmms_eval/__main__.py and lmms_eval/utils.py

* update

* Update llava.py with LLaVA model imports and error handling

* Add and test new datasets

* update

* Update wandb version and require report-editing:v0

* Add support for logging samples to Weights and Biases

This commit adds a new command-line argument `--wandb_log_samples` to enable logging all model outputs and documents for per-sample measurement and post-hoc analysis to Weights and Biases. The `cli_evaluate` function has been modified to handle this new argument and log the samples if the argument is set to True. The `wandb_logger` object has also been updated to include a new method `log_eval_samples` for logging the samples. This enhancement improves the functionality of the LMMS evaluation tool.

* update
kangreen0210 pushed a commit to kangreen0210/LIME that referenced this pull request Oct 6, 2024
* [Fix] rearrange location of init eval_logger

* Ignore DeprecationWarnings in lmms_eval/__main__.py and lmms_eval/models/fuyu.py

* Update lmms_eval/__main__.py and lmms_eval/utils.py

* update

* Update llava.py with LLaVA model imports and error handling

* Add and test new datasets

* update

* Update wandb version and require report-editing:v0

* Add support for logging samples to Weights and Biases

This commit adds a new command-line argument `--wandb_log_samples` to enable logging all model outputs and documents for per-sample measurement and post-hoc analysis to Weights and Biases. The `cli_evaluate` function has been modified to handle this new argument and log the samples if the argument is set to True. The `wandb_logger` object has also been updated to include a new method `log_eval_samples` for logging the samples. This enhancement improves the functionality of the LMMS evaluation tool.

* update
kangreen0210 pushed a commit to kangreen0210/LIME that referenced this pull request Oct 6, 2024
* [Fix] rearrange location of init eval_logger

* Ignore DeprecationWarnings in lmms_eval/__main__.py and lmms_eval/models/fuyu.py

* Update lmms_eval/__main__.py and lmms_eval/utils.py

* update

* Update llava.py with LLaVA model imports and error handling

* Add and test new datasets

* update

* Update wandb version and require report-editing:v0

* Add support for logging samples to Weights and Biases

This commit adds a new command-line argument `--wandb_log_samples` to enable logging all model outputs and documents for per-sample measurement and post-hoc analysis to Weights and Biases. The `cli_evaluate` function has been modified to handle this new argument and log the samples if the argument is set to True. The `wandb_logger` object has also been updated to include a new method `log_eval_samples` for logging the samples. This enhancement improves the functionality of the LMMS evaluation tool.

* update
kangreen0210 pushed a commit to kangreen0210/LIME that referenced this pull request Oct 6, 2024
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