Skip to content

Instantly share code, notes, and snippets.

View jpienaar's full-sized avatar

Jacques Pienaar jpienaar

View GitHub Profile
@jpienaar
jpienaar / draft.md
Last active August 13, 2023 14:50
Installing OpenXLA PJRT plugin

Install

pip install https://github.com/openxla/openxla-pjrt-plugin/releases/download/nightly/openxla_pjrt_plugin_cpu-0.1.dev1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -f https://openxla.github.io/iree/pip-release-links.html

Current state:

Snags:

@jpienaar
jpienaar / vim
Created September 15, 2022 03:18
Vim .mlirbc autocmd
" Read .mlirbc
:augroup mlir
: autocmd!
: autocmd BufReadPre,FileReadPre *.mlirbc set bin
: autocmd BufReadPost,FileReadPost *.mlirbc silent '[,']!mlir-opt
: autocmd BufReadPost,FileReadPost *.mlirbc set ft=mlir
: autocmd BufReadPost,FileReadPost *.mlirbc set nobin
: autocmd BufWritePost,FileWritePost *.mlirbc !mv <afile> <afile>.tmp.mlir
: autocmd BufWritePost,FileWritePost *.mlirbc !mlir-opt --emit-bytecode <afile>.tmp.mlir -o <afile>
:augroup END
(defcustom mlir-opt "mlir-opt"
"Commandline MLIR opt tool to use."
:type 'string)
(require 'jka-compr)
(add-to-list 'jka-compr-compression-info-list
(vector "\\.mlirbc\\'"
"mlir-to-bytecode" mlir-opt (vector "--emit-bytecode" "-o" "-" "-")
"mlir-bytecode-to-text" mlir-opt ()
nil nil "ML\357R"))
@jpienaar
jpienaar / grammar.js
Last active April 24, 2022 15:57
MLIR tree-sitter grammar (aiming for ~1:1 with langref for test)
module.exports = grammar({
name: 'mlir',
extras: $ => [
/\s/,
$.comment,
],
conflicts: $ => [
],
rules: {
// Top level production:
@jpienaar
jpienaar / reduce_dynamic.ipynb
Last active April 2, 2022 21:01
reduce_dynamic.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends gnupg ca-certificates
RUN sh -c 'echo deb https://apt.buildkite.com/buildkite-agent stable main > /etc/apt/sources.list.d/buildkite-agent.list'
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 32A37959C2FA5C3C99EFBC32A79206696452D198
@jpienaar
jpienaar / designer.html
Last active November 2, 2015 00:10
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../topeka-elements/category-icons.html">
<polymer-element name="my-element">
<template>