Skip to content

Instantly share code, notes, and snippets.

View sonots's full-sized avatar
🤗

Naotoshi Seo sonots

🤗
View GitHub Profile
@sonots
sonots / deployment-sample.yaml
Last active February 4, 2022 13:09
fluentd-firehose.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-sweet-api
spec:
template:
metadata:
annotations:
fluentd_firehose_delivery_stream_name: "my-sweet-firehose-stream-name"
@sonots
sonots / retry.sh
Last active December 9, 2020 01:25
#!/usr/bin/env bash
PROGNAME=$(basename $0)
function usage() {
echo "Usage: $PROGNAME [-c MAX_RETRY] [-s INTERVAL_SEC] -- COMMAND" 1>&2
echo " Retry a command if failed" 1>&2
echo "" 1>&2
echo "Options:" 1>&2
echo " -h, --help Show this message" 1>&2
2019-11-28 08:15:11 +0000 [info]: parsing config file is succeeded path="/etc/google-fluentd/google-fluentd.conf"
2019-11-28 08:15:12 +0000 [info]: Detected GCE platform
2019-11-28 08:15:12 +0000 [info]: Logs viewer address: https://console.cloud.google.com/logs/viewer?project=teak-kit-226806&resource=container/instance_id/7530681816608554840
2019-11-28 08:15:12 +0000 [info]: Detected GCE platform
2019-11-28 08:15:12 +0000 [info]: Logs viewer address: https://console.cloud.google.com/logs/viewer?project=teak-kit-226806&resource=gce_instance/instance_id/7530681816608554840
2019-11-28 08:15:12 +0000 [info]: Detected GCE platform
2019-11-28 08:15:12 +0000 [info]: Logs viewer address: https://console.cloud.google.com/logs/viewer?project=teak-kit-226806&resource=container/instance_id/7530681816608554840
2019-11-28 08:15:13 +0000 [warn]: 'time_format' specified without 'time_key', will be ignored
2019-11-28 08:15:13 +0000 [warn]: 'filters' parameter is deprecated: filters has been renamed as matches
2019-11-28 08:1
@sonots
sonots / runs-on: ubuntu-latest.txt
Last active August 26, 2022 09:46
Environment Variables on Github Actions
GOROOT_1_11_X64=/usr/local/go1.11
ANDROID_HOME=/usr/local/lib/android/sdk
JAVA_HOME_11_X64=/usr/lib/jvm/zulu-11-azure-amd64
ImageVersion=20190930.2
LANG=C.UTF-8
INVOCATION_ID=029524e610de4329ac57a8f3e8b21281
JAVA_HOME_12_X64=/usr/lib/jvm/zulu-12-azure-amd64
ANDROID_SDK_ROOT=/usr/local/lib/android/sdk
RUNNER_TOOL_CACHE=/opt/hostedtoolcache
JAVA_HOME=/usr/lib/jvm/zulu-11-azure-amd64
dtype = numpy.float32
batch_size = 2
in_channels = 3
out_channels =2
kernel_size = (3, 3, 1)
stride = (1, 1, 1)
pad = (0, 0, 0)
in_dims = (1000, 768, 3)
out_dims = (998, 766, 3)
x_shape = (batch_size, in_channels) + in_dims
$ brew install openblas
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BLAS and LAPACK in the Accelerate framework.

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openblas/lib
    CPPFLAGS: -I/usr/local/opt/openblas/include
For pkg-config to find this software you may need to set:
@sonots
sonots / gist:bdce8e970227eeb7bb0d29d0fa03452c
Last active February 5, 2018 16:35
nvvp with thrust::reduce
Is is asynchronous? or synchronous? How can we run asynchronously?

rb_thread_call_without_gvl を使う

例えば普通に書くと

nvrtcResult status = nvrtcCreateProgram(&_prog, _src, _name, _numHeaders, _headers, _includeNames);

となる C 関数の呼び出しを、GVLを外して呼び出すには、

@sonots
sonots / gdb with ruby.md
Last active January 4, 2018 16:26
gdb with ruby

bundle exec gdb とやると環境変数が渡って楽

$ bundle exec gdb ruby
gdb> run test.rb

コマンドラインで ruby への引数も渡したいときは --args オプションが使える。 ちなみに man gdb には出てこないが、gdb --help には出てくるオプション。

It occurred when I did not wait GPU process finishes.

#include <stdio.h>
#include <cuda_runtime.h>

__global__
void my_kernel(int val, int *A, int N)
{
 int i = threadIdx.x;