Views
No views yet


| Version | Throughput | Latency | Memory | Use Case |
|---|---|---|---|---|
| TensorRT (A100) | ~50,000/sec | <1ms | 2GB | Production inference |
| PyTorch Standard | ~1,000/sec | 10ms | 4GB | Research & development |
1# Install requirements (A100 + CUDA 12.8+ required)
2pip install -r tensorrt_requirements.txt
3
4# Verify TensorRT installation
5python -c "import tensorrt; print(tensorrt.__version__)" # Should be 10.13.x1from tensorrt_inference import WayraPPLTensorRT
2from transformers import AutoTokenizer
3
4# Load TensorRT model (A100 required)
5model = WayraPPLTensorRT("wayrappl_fp16_bs2048.engine")
6tokenizer = AutoTokenizer.from_pretrained("latam-gpt/Wayra-Perplexity-Estimator-55M")
7
8# Multilingual examples
9texts = [
10 # Spanish
11 "La inteligencia artificial está transformando el mundo.",
12 # Portuguese
13 "A tecnologia blockchain promete revolucionar sistemas financeiros.",
14 # English
15 "Natural language processing enables human-computer communication."
16]
17
18inputs = tokenizer(texts, return_tensors="pt", padding=True, truncation=True)
19outputs = model.infer(inputs['input_ids'].numpy(), inputs['attention_mask'].numpy())
20
21for i, text in enumerate(texts):
22 print(f"Text: {text}")
23 print(f"Perplexity: {outputs['ppl'][i]:.2f}\n")1from transformers import AutoTokenizer, AutoModel
2
3tokenizer = AutoTokenizer.from_pretrained("latam-gpt/Wayra-Perplexity-Estimator-55M")
4model = AutoModel.from_pretrained("latam-gpt/Wayra-Perplexity-Estimator-55M")
5
6texts = ["Your text here"]
7inputs = tokenizer(texts, return_tensors="pt", padding=True, truncation=True)
8outputs = model(**inputs)
9print(f"PPL: {outputs['ppl']}")1# TensorRT: ~2 hours for 100,000 examples
2# PyTorch: ~28 hours for 100,000 examples
3# Speedup: 14x faster with TensorRTwayrappl_fp16_bs2048.engine - TensorRT engine (A100 only)tensorrt_config.json - Engine configurationtensorrt_inference.py - Inference code with multilingual examplestensorrt_requirements.txt - Dependenciespytorch_model.bin - Model weightsconfig.json - Model configurationtokenizer.json - Tokenizer
| Model Type | Throughput | Latency | Memory | GPU Util | 100K Examples |
|---|---|---|---|---|---|
| Wayra TensorRT | ~50,000/sec | <1ms | 2GB | 95% | ~2 hours |
| Wayra PyTorch | ~1,000/sec | 10ms | 4GB | 60% | ~28 hours |
| Llama 3 1B | ~200/sec | 50ms | 8GB | 40% | ~139 hours |
nvidia-smi (should be 12.8+)python -c "import tensorrt" (should be 10.13.x)nvidia-smi (should be 570.124.06+)nvidia-smi -l 1pip uninstall tensorrt && pip install tensorrt==10.13.0nvidia-smi -q -d PERFORMANCEnvidia-smi -pm 11@software{WayraPPL,
2 title={WayraPPL: High-Performance Perplexity Estimation of Data Novelty},
3 author={Omar U. Florez and LatamGPT Team},
4 year={2025},
5 url={https://huggingface.co/latam-gpt/Wayra-Perplexity-Estimator-55M}
6}