Skip to content

Instantly share code, notes, and snippets.

@mattiasarro
mattiasarro / rwkv.py
Last active May 27, 2024 09:17
RWKV MVP
# Taken from https://johanwind.github.io/2023/03/23/rwkv_details.html.
# I've added additional comments restructured it a tiny bit, which makes it clearer for me.
import numpy as np
from torch import load as torch_load # Only for loading the model weights
from tokenizers import Tokenizer
exp = np.exp
layer_norm = lambda x, w, b : (x - np.mean(x)) / np.std(x) * w + b
sigmoid = lambda x : 1/(1 + exp(-x))
@mattiasarro
mattiasarro / tensorflow_1_6_high_sierra_gpu.md
Last active August 24, 2022 15:24 — forked from orpcam/tensorflow_1_6_rc1_high_sierra_gpu.md
Install Tensorflow 1.6 on macOS High Sierra 10.13.3 with GPU Acceleration (without disabling SIP)

Tensorflow 1.6 on macOS High Sierra 10.13.3 with GPU Acceleration (without disabling SIP)

This gist (based on a blog post at byai.io) documents how to set up TensorFlow 1.6 with (e)GPU support without the need to disable SIP. Following the original gist got me a saystem in which training TF on eGPU was successful, but there were various visual glitches due to the newer / less stable version of the driver.

As pointed out by ronchigram, many people are having issues with newer NVIDIA drivers, so it's worth using the nvidia-update script by Benjamin Dobell that installs the latest stable NVIDIA web driver, and if necessary patches it to run on your system. We also don't need to disable SIP when using nvidia-update.

I have als

INFO: From Compiling tensorflow/core/kernels/fused_batch_norm_op.cu.cc:
./tensorflow/core/lib/core/status.h(32): warning: attribute "warn_unused_result" does not apply here
./tensorflow/core/framework/variant.h(343): error: constexpr constructor calls non-constexpr function "std::__1::unique_ptr<_Tp, _Dp>::unique_ptr() [with _Tp=tensorflow::Variant::ValueInterface, _Dp=std::__1::default_delete<tensorflow::Variant::ValueInterface>]"
1 error detected in the compilation of "/var/folders/_8/__mwc41n7kq1__sy9mdkz3c80000gn/T//tmpxft_0000aeb2_00000000-7_fused_batch_norm_op.cu.cpp1.ii".
ERROR: /Users/m/code/3rd/tensorflow_1_4/tensorflow/core/kernels/BUILD:3230:1: output 'tensorflow/core/kernels/_objs/fused_batch_norm_util_gpu/tensorflow/core/kernels/fused_batch_norm_op.cu.pic.o' was not created.
ERROR: /Users/m/code/3rd/tensorflow_1_4/tensorflow/core/kernels/BUILD:3230:1: not all outputs were created or valid.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the
@mattiasarro
mattiasarro / tensorflow_configure.txt
Last active April 10, 2019 09:06
Example ./configure for TensorFlow (with GPU support) 1.2 on macOS
› ./configure
Please specify the location of python. [Default is /Users/m/code/3rd/conda/envs/p3gpu/bin/python]:
Found possible Python library paths:
/Users/m/code/3rd/conda/envs/p3gpu/lib/python3.6/site-packages
/Users/m/code/3rd/spark-2.1.0-bin-hadoop2.7//python
Please input the desired Python library path to use. Default is [/Users/m/code/3rd/conda/envs/p3gpu/lib/python3.6/site-packages]
Using python library path: /Users/m/code/3rd/conda/envs/p3gpu/lib/python3.6/site-packages
Do you wish to build TensorFlow with MKL support? [y/N] N
No MKL support will be enabled for TensorFlow
# Authors: Daniyal Shahrokhian, Mattias Arro
import numpy as np
from scipy.stats import bernoulli
# Generates n points(labels) accodring to the distribution of the exercise
def gen_points(x_values):
points = []
for x in x_values:
Cluster 0 words:
shaver
MENTION
Just
Electric
shaved
Cluster 0 tweets:
_body
Top terms per cluster:
Cluster 0 words:
lost
shaver
charger
've
beard
Electric
k1 = function(str) { key = OSX.keyCodes[str]; e = $.CGEventCreateKeyboardEvent(null, key, true); $.CGEventPost($.kCGSessionEventTap, e)}; k2 = function(str) { key = OSX.keyCodesRegular[str]; e = $.CGEventCreateKeyboardEvent(null, key, true); $.CGEventPost($.kCGSessionEventTap, e)}; k3 = function(str) { key = OSX.keyCodesShift[str]; e = $.CGEventCreateKeyboardEvent(null, key, true); $.CGEventPost($.kCGSessionEventTap, e)}
diff --git a/app/models/ticketing/ticket_transaction.rb b/app/models/ticketing/ticket_transaction.rb
index 50b3a3c..3a6ea7d 100644
--- a/app/models/ticketing/ticket_transaction.rb
+++ b/app/models/ticketing/ticket_transaction.rb
@@ -48,12 +48,20 @@ class TicketTransaction < ActiveRecord::Base
def state_cleared
self.update_column(:cleared_at, DateTime.now)
+ complete! unless require_guest_names
end
[vagrant@vagrant-centos-6 vagrant]$ rake sphinx:stop
Booting asw-api in development environment
Braintree transactions will run in sandbox mode
Skipping migrations check - have you remembered to run migrations recently?
PayPal transactions will run in sandbox mode
Pensio transactions will run in sandbox mode
Setting Resque to use Redis server at localhost:6379
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Stopping - Dispatcher... couldn't find PID file - no action taken.
Stopping - Delta Script... couldn't find PID file - no action taken.