git clone https://github.com/UCLA-VAST/Stream-HLS
cd Stream-HLS
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11 python3.11-venv
python3.11 -m venv env
. env/bin/activate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -ex | |
. ../env/bin/activate | |
python3 jax_test.py | |
iree-opt ./jax.stablehlo.mlir \ | |
--iree-stablehlo-input-transformation-pipeline \ | |
--convert-scf-to-cf \ | |
> jax.linalg.mlir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jax | |
import jax.numpy as jnp | |
import matplotlib.pyplot as plt | |
def normalize(x): | |
return x / jnp.linalg.norm(x) | |
def vec(x, y, z): | |
return jnp.array([x, y, z], dtype='float32') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jax | |
import jax.numpy as jnp | |
import matplotlib.pyplot as plt | |
import functools | |
import typing | |
def main(): | |
params = IOCellParams(g_CaL=1.2) | |
state0 = IOCellState.make(params) | |
@jax.jit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for model in paper_experiments/nml_standalones/*/ | |
do | |
echo -n "$(basename "${model}")" | |
for fun in log exp sqrt sin cos tan sinh cosh tanh abs ceil factorial random | |
do | |
if rg \ | |
-q \ | |
-i \ | |
-g '*.nml' \ | |
'\b'"${fun}"'\b' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Conv' ############################################################################################################################################################# | |
'MaxPool' ################################################################################################################################################# | |
'Relu' ############################################################################################################################################# | |
'Reshape' ################################################################################################################################## | |
'Softmax' ########################################################################################################## | |
'Concat' ################################################################################################## | |
'Add' ######################## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jax | |
import iree.compiler as compiler | |
def YOUR_FUNCTION(x): | |
return x + 1 | |
input_sample = [ | |
jax.numpy.array([0.,]) | |
] |
Excerpt from this issue: patrick-kidger/diffrax#202
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import numpy as np | |
import norse.torch as norse | |
import matplotlib.pyplot as plt | |
import tqdm.notebook as tqdm | |
_ = torch.manual_seed(0) | |
class MyModule(torch.nn.Module): | |
def __init__(self, p=norse.LIFParameters()): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* C implementation of | |
* Yang, Yuning, and Andrew J. Mason. "Hardware efficient automatic | |
* thresholding for NEO-based neural spike detection." IEEE Transactions | |
* on Biomedical Engineering 64.4 (2016): 826-833. | |
* | |
* Writted by Lennart P. L. Landsmeer | |
* NeurocomputingLab, Erasmus MC | |
* */ | |
#include <stdint.h> |
NewerOlder