Skip to content

Commit

Permalink
fixed model name, and set log level to INFO
Browse files Browse the repository at this point in the history
  • Loading branch information
shvbsle committed Jan 16, 2025
1 parent 2f69e03 commit d5de365
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/images/neuron-inference/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
handlers=[logging.StreamHandler(sys.stdout)]
)
logger = logging.getLogger("BERTNeuronInference")
logger.setLevel(logging.INFO)

def get_neuron_monitor_stats():
"""
Expand Down Expand Up @@ -183,10 +184,13 @@ def run_inference(model, tokenizer, batch_size, mode, n_models=2, n_threads=2):
Returns:
None, but prints performance metrics including:
- Duration of the job
- Average time per batch
- Throughput (samples per second)
- P50, P95, P99 latency
-
- Batch Size
- Total Batches Processed
- Total Inferences
Notes:
- Performance metrics are logged with prefix [BERT_INFERENCE_NEURON_METRICS]
Expand Down Expand Up @@ -330,7 +334,7 @@ def main():

print_info("Loading tokenizer and model...")
try:
model_name = "bert-base-cased"
model_name = "bert-base-uncased"
tokenizer = BertTokenizer.from_pretrained(model_name)
model = BertForPreTraining.from_pretrained(model_name)

Expand Down

0 comments on commit d5de365

Please sign in to comment.