cleanup data_parallel.py

Signed-off-by: Sage Moore <sage@neuralmagic.com>
This commit is contained in:
Sage Moore 2025-07-03 13:02:12 +00:00
parent be2e1632fd
commit 9b7edc0343

View File

@ -113,11 +113,7 @@ def main(
"The president of the United States is", "The president of the United States is",
"The capital of France is", "The capital of France is",
"The future of AI is", "The future of AI is",
] * 10 ] * 100
# import random
# import string
# prompts = [''.join(random.choices(string.ascii_letters, k=128)) for _ in range(2048)]
# with DP, each rank should process different prompts. # with DP, each rank should process different prompts.
# usually all the DP ranks process a full dataset, # usually all the DP ranks process a full dataset,
@ -141,7 +137,7 @@ def main(
# sampling params. here we set different max_tokens for different # sampling params. here we set different max_tokens for different
# ranks for demonstration. # ranks for demonstration.
sampling_params = SamplingParams( sampling_params = SamplingParams(
temperature=0.8, top_p=0.95, max_tokens=[40, 64][global_dp_rank % 2] temperature=0.8, top_p=0.95, max_tokens=[16, 20][global_dp_rank % 2]
) )
# Create an LLM. # Create an LLM.