Skip to content

Commit

Permalink
neuroir.org website (#104)
Browse files Browse the repository at this point in the history
* Fixed Norse example
* Added NIR website and gh pages workflow
* Added gh trigger for feature-docs
* Added jupyter book to dependencies
  • Loading branch information
Jegp committed May 4, 2024
1 parent 8f9177e commit 3442157
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 8 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy docs to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Prepare site dir
run: |
cp -r docs/neuroir.org _site
- name: Build Jupyter Book
run: |
jupyter-book build docs/source # Will put this in docs/source/_build/html
mv docs/source/_build/html _site/docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
109 changes: 109 additions & 0 deletions docs/neuroir.org/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Neuromorphic Intermediate Representation</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css" />

<style>
@import url('https://fonts.googleapis.com/css2?family=Cinzel&display=swap');

@font-face {
font-family: 'Cinzel';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(static/Cinzel-Regular.ttf) format('ttf');
}

.font-cinzel {
font-family: 'Cinzel', serif;
}
[class*="iconoir-"] {
vertical-align: middle;
margin-top: -0.2rem;
}
</style>
</head>

<body class="bg-stone-100">

<!-- Header Section -->
<header class="bg-gray-800 py-20">
<div class="mx-auto md:flex flex-row">
<div class="basis-1/1 md:basis-2/4">
<a href="https://neuroir.org">
<h1 class="text-white text-4xl md:text-7xl font-bold text-center md:text-right font-cinzel">Neuromorphic
<br />Intermediate
<br />Representation
</h1>
</a>
</div>
<div class="basis-1/1 md:basis-1/6 m-2" style="align-content: center;">
<div class="flex flex-col">
<a href="https://neuroir.org/docs" class="bg-amber-500 text-white py-2 px-4 rounded-md font-semibold shadow-md m-2
hover:bg-amber-600 hover:text-stone-100 transition duration-300 ease-in-out text-xl md:text-lg">
<i class="iconoir-book-stack"></i> Read the docs</a>
<a href="https://github.com/neuromorphs/nir" class="bg-white text-amber-600 py-2 px-4 rounded-md font-semibold shadow-md m-2 text-xl md:text-lg
hover:bg-stone-200 transition duration-300 ease-in-out">
<i class="iconoir-github"></i> Inspect our code</a>
</div>
</div>
</div>
</header>

<!-- Main Content Section -->
<section class="container mx-auto py-8">
<div class="max-w-3xl mx-auto">
<img src="https://github.com/neuromorphs/NIR/raw/main/docs/logo_light.png"
class="rounded border-slate-500 shadow-md m-2" alt="Logo">
<div class="text-gray-800 m-2 text-lg">
<p class="leading-relaxed">
The Neuromorphic Intermediate Representation (NIR) is an exchange format that translates <a class="text-stone-600" href="https://en.wikipedia.org/wiki/Neuromorphic">neuromorphic software</a> from one platform to another.
NIR is supported by numerous neuromorphic simulators, and is the preferred choice for <span class="text-black font-bold">porting models to neuromorphic hardware platforms</span>.</p>
<p class="leading-relaxed mt-4">NIR allows researchers and companies to build their software independently from the hardware&emdash;and vice versa.
Developers save time by focusing on the NIR graph integration.
Users save time by letting them use their favourite toolchain.
The seamless translation between software and hardware let's you focus on the job instead of the ecosystem.
</p>
<p class="m-4 grid">
<a href="https://github.com/neuromorphs/nir" class="bg-white text-amber-600 py-2 px-4 rounded-md font-semibold shadow-md text-lg text-center
hover:bg-stone-100 transition duration-300 ease-in-out col-span-8">
<i class="iconoir-link"></i> See our supported platforms</a>
</p>
</div>
</div>
</section>

<!-- Acknowledgement Section -->
<footer class="bg-gray-900 text-white py-8">
<div class="container mx-auto text-center">
<h2 class="text-2xl font-semibold">Acknowledgement</h2>
<p class="text-lg mt-2">If you use NIR in your research, please cite the following:</p>
<pre class="text-lg mt-2 bg-gray-800 p-4 rounded-md text-left"><code>
@article{NIR_2023,
title={Neuromorphic Intermediate Representation: A Unified Instruction Set for Interoperable Brain-Inspired Computing},
url={http://arxiv.org/abs/2311.14641},
DOI={10.48550/arXiv.2311.14641},
note={arXiv:2311.14641 [cs]},
number={arXiv:2311.14641},
publisher={arXiv},
author={Pedersen, Jens E. and Abreu, Steven and Jobst, Matthias and Lenz, Gregor
and Fra, Vittorio and Bauer, Felix C. and Muir, Dylan R. and Zhou, Peng and
Vogginger, Bernhard and Heckel, Kade and Urgese, Gianvito and Shankar, Sadasivan
and Stewart, Terrence C. and Eshraghian, Jason K. and Sheik, Sadique
},
year={2023},
month=nov
}
</code></pre>
<p class="text-lg mt-2">All rights reserved &copy; 2024 the NIR authors.</p>
</div>
</footer>

</body>

</html>
Binary file added docs/neuroir.org/static/Cinzel-Regular.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ sphinx-book-theme
myst_nb
numpy
h5py
jupyter-book
sphinx_external_toc
sphinxcontrib-mermaid
astroid~=2.15 # https://github.com/readthedocs/sphinx-autoapi/issues/407
Expand Down
28 changes: 21 additions & 7 deletions docs/source/examples/norse/nir-conversion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,36 @@
"import nir\n",
"\n",
"# Create a network\n",
"network = norse.SequentialStateful(norse.LIFCell(), torch.nn.Linear(1, 1))\n",
"network = norse.SequentialState(norse.LIFCell(), torch.nn.Linear(1, 1))\n",
"\n",
"# Export to nir\n",
"nir_model = norse.to_nir(network)\n",
"sample_data = torch.randn(1, 1)\n",
"nir_model = norse.to_nir(network, sample_data)\n",
"\n",
"# Save to file\n",
"nir.write(\"nir_model.nir\", nir_model)\n"
"nir.write(\"nir_model.nir\", nir_model)"
]
}
],
"metadata": {
"language_info": {
"name": "python"
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"orig_nbformat": 4
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
2 changes: 1 addition & 1 deletion docs/source/examples/rockpool/nir-conversion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"# Rockpool\n",
"\n",
"... coming soon"
"Rockpool will be supported in a future release. Stay tuned!"
]
}
],
Expand Down

0 comments on commit 3442157

Please sign in to comment.