Skip to content

Instantly share code, notes, and snippets.

View weedge's full-sized avatar
🍀
coding at home

weedge weedge

🍀
coding at home
View GitHub Profile
import os
import torch
from openvoice import se_extractor
from openvoice.api import ToneColorConverter
ckpt_converter = 'checkpoints_v2/converter'
device = "cuda:0" if torch.cuda.is_available() else "cpu"
output_dir = 'outputs_v2'
print(device)
from melo.api import TTS
import os
import torch
from openvoice import se_extractor
from openvoice.api import ToneColorConverter
ckpt_converter = 'checkpoints_v2/converter'
device = "cuda:0" if torch.cuda.is_available() else "cpu"
output_dir = 'outputs_v2'
print(device)
@weedge
weedge / nvvp.md
Created November 2, 2023 03:16 — forked from sonots/nvvp.md
How to use NVIDIA profiler

Usually, located at /usr/local/cuda/bin

Non-Visual Profiler

$ nvprof python train_mnist.py

I prefer to use --print-gpu-trace.

@weedge
weedge / bitonic_sort.cu
Created October 25, 2023 02:57 — forked from mre/bitonic_sort.cu
Bitonic Sort on CUDA. On a quick benchmark it was 10x faster than the CPU version.
/*
* Parallel bitonic sort using CUDA.
* Compile with
* nvcc -arch=sm_11 bitonic_sort.cu
* Based on http://www.tools-of-computing.com/tc/CS/Sorts/bitonic_sort.htm
* License: BSD 3
*/
#include <stdlib.h>
#include <stdio.h>
@weedge
weedge / l2sqr_functions.cpp
Created October 23, 2023 05:17 — forked from matsui528/l2sqr_functions.cpp
Runtime evaluation for squared Euclidean distances with SSE, AVX, AVX512 implementations
#include <iostream>
#include <random>
#include <chrono>
#include <x86intrin.h>
#include <cassert>
// Runtime evaluation for squared Eucliden distance functions
// - fvec_L2_sqr_ref: naive reference impl from Faiss
// - fvec_L2_sqr_sse: SSE impl from Faiss
// - fvec_L2_sqr_avx: AVX impl from Faiss
@weedge
weedge / Makefile
Created September 1, 2023 08:37 — forked from kwk/Makefile
Compiling with Address Sanitizer (ASAN) with CLANG and with GCC-4.8
.PHONY: using-gcc using-gcc-static using-clang
using-gcc:
g++-4.8 -o main-gcc -lasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc
using-gcc-static:
g++-4.8 -o main-gcc-static -static-libstdc++ -static-libasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc-static
@weedge
weedge / Makefile
Created August 8, 2023 15:47 — forked from itamarhaber/Makefile
Module development environment walkthrough
SHOBJ_CFLAGS ?= -fno-common -g -ggdb
SHOBJ_LDFLAGS ?= -shared -Bsymbolic
CFLAGS = -Wall -g -fPIC -lc -lm -Og -std=gnu99
CC=gcc
all: example.so
example.so: example.o
$(LD) -o $@ example.o $(SHOBJ_LDFLAGS) $(LIBS) -lc
show engines;
show databases;
drop database pay;
create database pay ;
use pay;
show tables;
drop table `pay`.`user_asset`;
CREATE TABLE `user_asset`
(
`userId` bigint unsigned NOT NULL DEFAULT '0',
show engines;
show databases;
show variables like "%partition%" ;
SHOW NODE;
drop database pay;
create database pay PARTITION_MODE=partitioning;
SHOW CREATE DATABASE pay;
use pay;
package main
import (
"context"
"log"
"os"
"os/signal"
"syscall"
"github.com/apache/rocketmq-client-go/v2"