Skip to content

Instantly share code, notes, and snippets.

View jeethu's full-sized avatar

Jeethu Rao jeethu

View GitHub Profile
@jeethu
jeethu / bench.cpp
Created August 27, 2024 19:58
neon_fast_exp benchmark
#include <arm_neon.h>
#include <benchmark/benchmark.h>
inline float16x8_t neon_fast_exp(float16x8_t x) {
x = vmulq_f16(x, vdupq_n_f16(float16_t(1.442695f))); // multiply with log_2(e)
x = vmaxq_f16(x, vdupq_n_f16(float16_t(-14.f))); // clamp under with -14
x = vminq_f16(x, vdupq_n_f16(float16_t(14.f))); // clamp over with 14
float16x8_t ipart = vrndmq_f16(vaddq_f16(x, vdupq_n_f16(float16_t(0.5f))));
float16x8_t fpart = vsubq_f16(x, ipart);
@jeethu
jeethu / live_signals_sharpe_sortino.ipynb
Last active July 8, 2021 17:22
Live annualized Sharpe and Sortino metrics for Numerai Signals
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeethu
jeethu / evaluation.py
Created August 25, 2020 17:01
Numerai Model Evaluation
import functools
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.table as table
import numpy as np
import pandas as pd
from scipy.stats import spearmanr
TOURNAMENT_NAME = "kazutsugi"
@jeethu
jeethu / example_model.py
Created April 23, 2020 19:20
numerai example_model with int8 features
#!/usr/bin/env python
"""
Example classifier on Numerai data using a xgboost regression.
To get started, install the required packages: pip install pandas numpy sklearn xgboost
"""
import csv
import pandas as pd
import numpy as np
@jeethu
jeethu / example_model.py
Created January 17, 2020 12:13
Numerai example_model.py using np.float16 for features and target
#!/usr/bin/env python
"""
Example classifier on Numerai data using a xgboost regression.
To get started, install the required packages: pip install pandas numpy sklearn xgboost
"""
import csv
import pandas as pd
import numpy as np
3.8_baseline4.json
==================
Performance version: 0.7.0
Report on Linux-4.15.0-43-generic-x86_64-with-glibc2.26
Number of logical CPUs: 4
Start date: 2019-01-23 23:27:43.675291
End date: 2019-01-24 00:00:30.138941
3.8_load_const_ref4.json
@jeethu
jeethu / gist:19430d802aa08e28d1cb5eb20a47a470
Created January 17, 2018 00:55
perf timeit comparison Raw
jeethu@Odin:~/Projects/cpython$ # Baseline
jeethu@Odin:~/Projects/cpython$ taskset -c 2,3,6,7 python3 -m perf timeit --python=~/Projects/cpython/venv/cpython3.7-487fa3ea092b/bin/python -s 'l=[]' $(python3 -c 'print("l.insert(0, None); " * 100 + "l.clear();")') --duplicate 100
.....................
WARNING: the benchmark result may be unstable
* the standard deviation (1.37 us) is 13% of the mean (10.5 us)
Try to rerun the benchmark with more runs, values and/or loops.
Run 'python3 -m perf system tune' command to reduce the system jitter.
Use perf stats, perf dump and perf hist to analyze results.
Use --quiet option to hide these warnings.
@jeethu
jeethu / gist:2d2de55afdb8ea4ad03b6a5d04d5227f
Created January 17, 2018 00:04
perf timeit comparison
jeethu@Odin:~/Projects/cpython$ # Baseline
jeethu@Odin:~/Projects/cpython$ ~/Projects/cpython/venv/cpython3.7-487fa3ea092b/bin/python -c "import sys;print(sys.version)"
3.7.0a4+ (heads/master:9f1b7b93f5, Jan 16 2018, 19:15:03)
[GCC 7.2.0]
jeethu@Odin:~/Projects/cpython$ taskset -c 2,3,6,7 python3 -m perf timeit --python=~/Projects/cpython/venv/cpython3.7-487fa3ea092b/bin/python -s 'l=[];ins=l.insert' $(python3 -c 'print("ins(0, None); " * 100 + "l.clear();")') --duplicate 100
.....................
Mean +- std dev: 6.55 us +- 0.03 us
jeethu@Odin:~/Projects/cpython$ # py37_list_insert_memmove
.file "listobject.c"
.intel_syntax noprefix
.text
.p2align 4,,15
.type list_reverse, @function
list_reverse:
.LFB125:
.cfi_startproc
mov rdx, QWORD PTR 16[rdi]
cmp rdx, 1
py37_baseline-no-pgo-no-lto.json
================================
Performance version: 0.6.0
Report on Linux-4.13.0-19-generic-x86_64-with-debian-stretch-sid
Number of logical CPUs: 8
Start date: 2018-01-16 21:08:29.457607
End date: 2018-01-16 21:46:10.018098
py37_list_insert_memmove-t32-no-pgo-no-lto.json