Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nemo_deploy/llm/inference/tron_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def _set_random_seed(
te_rng_tracker: bool = False,
inference_rng_tracker: bool = False,
) -> None:
"""Set random seed for reproducability.
"""Set random seed for reproducibility.

Args:
seed_ (int): Base random seed to use
Expand Down Expand Up @@ -332,7 +332,7 @@ def _initialize_tp_communicators(model_config: Union[GPTConfig, T5Config], micro
bootstrap_backend=bootstrap_backend,
)
except TypeError:
# Fallback for older TE versions
# Fallback for older Transformer Engine versions
if bootstrap_backend != "mpi":
LOGGER.info("Warning: Transformer Engine may only support MPI bootstrap backend")

Expand Down
6 changes: 3 additions & 3 deletions nemo_deploy/llm/megatronllm_deployable.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MegatronLLMDeployable(ITritonDeployable):
context_parallel_size (int): context parallelism.
expert_model_parallel_size (int): expert parallelism.
params_dtype (torch.dtype): max input length.
inference_batch_times_seqlen_threshold (int): squence threshold.
inference_batch_times_seqlen_threshold (int): sequence threshold.
inference_max_seq_length (int): max_seq_length for inference. Required by MCoreEngine (>=0.12). Defaults to
4096.
max_batch_size (int): max batch size for inference. Defaults to 32.
Expand Down Expand Up @@ -455,7 +455,7 @@ def _infer_fn(
if log_probs:
output_log_probs = []
for r in results:
# Convert to torch tensor and then move to cpu as generated_log_probs is a list and cant be moved
# Convert to torch tensor and then move to cpu as generated_log_probs is a list and cannot be moved
# to cpu otherwise
if echo:
lp = torch.tensor(r.prompt_log_probs + r.generated_log_probs).cpu().detach().numpy()
Expand All @@ -481,7 +481,7 @@ def _infer_fn(
if top_logprobs:
output_top_n_log_probs = []
for r in results:
# Convert to torch tensor and then move to cpu as generated_log_probs is a list and cant be moved
# Convert to torch tensor and then move to cpu as generated_log_probs is a list and cannot be moved
# to cpu otherwise.
# top_logprobs for input tokens is supported with MCore 0.13 and above.
if echo:
Expand Down
2 changes: 1 addition & 1 deletion nemo_deploy/service/fastapi_interface_to_pytriton.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ async def chat_completions_v1(request: ChatCompletionRequest):
prompts = request.messages
if not isinstance(request.messages, list):
prompts = [request.messages]
# Serialize the dictionary to a JSON string represnetation to be able to convert to numpy array
# Serialize the dictionary to a JSON string representation to be able to convert to numpy array
# (str_list2numpy) and back to list (str_ndarray2list) as required by PyTriton. Using the dictionaries directly
# with these methods is not possible as they expect string type.
json_prompts = [dict_to_str(prompts)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ async def chat_completions_v1(request: MultimodalChatCompletionRequest):
# Remove image_url field
content.pop("image_url", None)

# Serialize the dictionary to a JSON string represnetation to be able to convert to numpy array
# Serialize the dictionary to a JSON string representation to be able to convert to numpy array
# (str_list2numpy) and back to list (str_ndarray2list) as required by PyTriton. Using the dictionaries directly
# with these methods is not possible as they expect string type.
json_prompts = [dict_to_str(prompts)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def get_llama_bidirectional_hf_model(
# configure pooling
pooling_module = Pooling(pooling_mode=pooling_mode)

# NV-Embed-v1 model has seperate embedding model and a built-in pooling module
# NV-Embed-v1 model has separate embedding model and a built-in pooling module
if (
model.__class__.__name__ == "NVEmbedModel"
and hasattr(model, "latent_attention_model")
Expand Down
2 changes: 1 addition & 1 deletion nemo_export/utils/lora_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def convert_lora_nemo_to_canonical(lora_nemo, save_path, hf_format=False, donor_
new_key = replace_number_add_offset(key, layer_offset)
lora_state_dict[tp][new_key] = value

# TODO: currently suport tp=1
# TODO: currently support tp=1
lora_state_dict = lora_state_dict[0]
if lora_config["peft"]["lora_tuning"].get("variant", "nemo") == "nemo":
lora_config["peft"]["lora_tuning"]["variant"] = "canonical"
Expand Down
4 changes: 2 additions & 2 deletions nemo_export/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ def get_example_inputs(


def validate_fp8_network(network) -> None:
"""Checks the network to ensure it's compatible with fp8 precison.
"""Checks the network to ensure it's compatible with fp8 precision.

Raises:
ValueError if netowrk doesn't container Q/DQ FP8 layers
ValueError if network doesn't container Q/DQ FP8 layers
"""
import tensorrt as trt

Expand Down
2 changes: 1 addition & 1 deletion nemo_export_deploy_common/import_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def gpu_only_import(module, *, alt=None) -> Tuple[object, bool]:

return safe_import(
module,
msg=f"{module} is not enabled in non GPU-enabled installations or environemnts. {GPU_INSTALL_STRING}",
msg=f"{module} is not enabled in non GPU-enabled installations or environments. {GPU_INSTALL_STRING}",
alt=alt,
)

Expand Down
4 changes: 2 additions & 2 deletions tests/functional_tests/utils/run_nemo_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def run_inference(

functional_result = FunctionalResult()

# Check non-deployed funcitonal correctness
# Check non-deployed functional correctness
if args.functional_test:
functional_result.regular_pass = True
if not check_model_outputs(output, expected_outputs):
Expand Down Expand Up @@ -742,7 +742,7 @@ def optional_bool_to_pass_fail(b: Optional[bool]):
if args.functional_test:
print(f"Functional: {functional_test_result}")
if args.run_accuracy:
print(f"Acccuracy: {accuracy_test_result}")
print(f"Accuracy: {accuracy_test_result}")

if functional_test_result == "FAIL":
raise Exception("Functional test failed")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def forward_loop(model, data, tokenizer):
"/ReduceL2",
"/Div",
]
# Model specific operation wheter to override layernorm precision or not.
# Model specific operation whether to override layernorm precision or not.
override_layernorm_precision_to_fp32 = True
profiling_verbosity = "layer_names_only"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def export_onnx_trt(args):
"/model/norm/",
"/Div",
]
# Model specific operation wheter to override layernorm precision or not.
# Model specific operation whether to override layernorm precision or not.
override_layernorm_precision_to_fp32 = True
profiling_verbosity = "layer_names_only"

Expand Down
2 changes: 1 addition & 1 deletion tests/functional_tests/utils/test_export_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def forward_loop(model, data, tokenizer):
"/ReduceL2",
"/Div",
]
# Model specific operation wheter to override layernorm precision or not.
# Model specific operation whether to override layernorm precision or not.
override_layernorm_precision_to_fp32 = True
profiling_verbosity = "layer_names_only"

Expand Down
Loading