Skip to content

Instantly share code, notes, and snippets.

View gante's full-sized avatar
🧘

Joao Gante gante

🧘
View GitHub Profile
@gante
gante / generate_benchmark.py
Last active December 19, 2022 16:39
Benchmark Hugging Face generation for PT, FLAX, TF with Eager Execution, and TF with XLA.
import os
import time
from datetime import timedelta
from functools import wraps, partial
from tqdm import tqdm
# JAX imports and settings
os.environ["XLA_PYTHON_CLIENT_PREALLOCATE"] = "false"
import jax