Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@npalaska
Copy link
Contributor

Currently, the batch size for SDG is only configurable via the CLI, but a single batch size across all hardware profiles is not optimal. Different hardware configurations have varying capabilities, and using a fixed batch size can lead to under-utilization or over-utilization of resources during the SDG process.

To ensure efficient performance across different hardware, we should set the batch sizes independently in each system profile.

@mergify mergify bot added testing Relates to testing ci-failure PR has at least one CI failure labels Feb 17, 2025
Copy link
Contributor

@cdoern cdoern left a comment

Choose a reason for hiding this comment

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

looks good! Technically, if you are using the default value you don't need to add this to all of the profiles manually. One comment about the default in the click flag.

default=None,
help="Number of elements to process in each batch through the SDG pipeline. Enabled by default for the vLLM serving backend, with a batch size of 8 chosen based on experiments to optimize for throughput. Use 0 to disable.",
cls=clickext.ConfigOption,
default=DEFAULTS.BATCH_SIZE,
Copy link
Contributor

Choose a reason for hiding this comment

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

the default comes from the config when you set cls=... so no default is necessary here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @cdoern, hmm I think I am missing something. If I run ilab data generate --debug-params. I get all the values of the parameter correct except for the batch size for which I get
batch_size: None [type: None, src: default] (if I remove the default)

@npalaska npalaska force-pushed the configurable_batch_size branch from 576aa76 to f4e8c50 Compare February 17, 2025 21:33
@mergify mergify bot removed the ci-failure PR has at least one CI failure label Feb 17, 2025
@npalaska npalaska requested a review from cdoern February 17, 2025 21:41
default=None,
help="Number of elements to process in each batch through the SDG pipeline. Enabled by default for the vLLM serving backend, with a batch size of 8 chosen based on experiments to optimize for throughput. Use 0 to disable.",
cls=clickext.ConfigOption,
default=DEFAULTS.BATCH_SIZE,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
default=DEFAULTS.BATCH_SIZE,

removing this line and re-installing I get the following:

ilab data generate --debug-params
Parameters:
             model_path: '/Users/charliedoern/.cache/instructlab/models/mistral-7b-instruct-v0.2.Q4_K_M.gguf' 	[type: str, src: default_map]
               num_cpus: 10       	[type: int, src: default_map]
       chunk_word_count: 1000     	[type: int, src: default_map]
       num_instructions: -1       	[type: int, src: default]
       sdg_scale_factor: 30       	[type: int, src: default_map]
          taxonomy_path: '/Users/charliedoern/.local/share/instructlab/taxonomy' 	[type: str, src: default_map]
          taxonomy_base: 'origin/main' 	[type: str, src: default_map]
             output_dir: '/Users/charliedoern/.local/share/instructlab/datasets' 	[type: str, src: default_map]
                  quiet: False    	[type: bool, src: default]
           endpoint_url: None     	[type: None, src: default]
                api_key: 'no_api_key' 	[type: str, src: default]
             yaml_rules: None     	[type: None, src: default]
        server_ctx_size: 4096     	[type: int, src: default]
           tls_insecure: False    	[type: bool, src: default]
        tls_client_cert: ''       	[type: str, src: default]
         tls_client_key: ''       	[type: str, src: default]
      tls_client_passwd: ''       	[type: str, src: default]
           model_family: None     	[type: None, src: default]
               pipeline: 'full'   	[type: str, src: default_map]
             batch_size: 8        	[type: int, src: default_map]
  enable_serving_output: False    	[type: bool, src: default]
                   gpus: None     	[type: None, src: default_map]
         max_num_tokens: 4096     	[type: int, src: default_map]
               detached: False    	[type: bool, src: default]

Copy link
Contributor Author

@npalaska npalaska Feb 17, 2025

Choose a reason for hiding this comment

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

Thanks it indeed worked after I reinstalled it

@mergify mergify bot added the ci-failure PR has at least one CI failure label Feb 17, 2025
@cdoern
Copy link
Contributor

cdoern commented Feb 19, 2025

@Mergifyio rebase

@mergify
Copy link
Contributor

mergify bot commented Feb 19, 2025

rebase

✅ Branch has been successfully rebased

@cdoern cdoern force-pushed the configurable_batch_size branch from f4e8c50 to bb2eb90 Compare February 19, 2025 00:58
@mergify mergify bot added one-approval PR has one approval from a maintainer and removed ci-failure PR has at least one CI failure labels Feb 19, 2025
Copy link

@eshwarprasadS eshwarprasadS left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@mergify mergify bot added the ci-failure PR has at least one CI failure label Feb 19, 2025
@npalaska npalaska force-pushed the configurable_batch_size branch from bb2eb90 to 4a309ce Compare February 24, 2025 17:55
@mergify mergify bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Feb 24, 2025
@mergify mergify bot removed the one-approval PR has one approval from a maintainer label Feb 26, 2025
@nathan-weinberg nathan-weinberg removed the request for review from eshwarprasadS February 26, 2025 17:39
@mergify mergify bot merged commit fb13de1 into instructlab:main Feb 26, 2025
29 checks passed
@ktdreyer
Copy link
Contributor

@mergify backport release-v0.24

@mergify
Copy link
Contributor

mergify bot commented Feb 28, 2025

backport release-v0.24

✅ Backports have been created

Details

@ktdreyer
Copy link
Contributor

@mergify backport release-v0.23

@mergify
Copy link
Contributor

mergify bot commented Feb 28, 2025

backport release-v0.23

✅ Backports have been created

Details

ktdreyer added a commit that referenced this pull request Mar 3, 2025
…-3157

Make SDG batch size configurable via system profile (backport #3157)
mergify bot added a commit that referenced this pull request Mar 3, 2025
…3207)

Currently, the batch size for SDG is only configurable via the CLI, but a single batch size across all hardware profiles is not optimal. Different hardware configurations have varying capabilities, and using a fixed batch size can lead to under-utilization or over-utilization of resources during the SDG process.

To ensure efficient performance across different hardware, we should set the batch sizes independently in each system profile. <hr>This is an automatic backport of pull request #3157 done by [Mergify](https://mergify.com).


Approved-by: courtneypacheco

Approved-by: ktdreyer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Relates to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants