Skip to content

Instantly share code, notes, and snippets.

View yoavartzi's full-sized avatar

Yoav Artzi yoavartzi

View GitHub Profile
@yoavartzi
yoavartzi / time-gpu.py
Created October 31, 2025 17:09
Example code for timing MPS vs. CPU (credits to Zoe Chen)
# %%
import torch
import timeit
import matplotlib.pyplot as plt
def bench(dev, batch_size, hidden_size):
x = torch.ones(batch_size, 5, device=dev)
model = torch.nn.Sequential(
torch.nn.Linear(5, hidden_size),
#!/bin/bash
set -e
if [ -z "$1" ]; then
echo "Usage: $0 <arxiv_abs_or_pdf_url>"
exit 1
fi
URL="$1"
@yoavartzi
yoavartzi / colm-preprint-setting.md
Last active April 2, 2024 19:34
COLM preprint setting

The template doesn't currently support this, but we will try to incorporate this in the future.

In the meantime, you can easily modify the template. This is the place to look at:

\ifcolmfinal
    \lhead{Published as a conference paper at COLM 2024}
    \def\And{\end{tabular}\hfil\linebreak[0]\hfil
            \begin{tabular}[t]{l}\bf\rule{\z@}{24pt}\ignorespaces}%
  \def\AND{\end{tabular}\hfil\linebreak[4]\hfil
            \begin{tabular}[t]{l}\bf\rule{\z@}{24pt}\ignorespaces}%