A powerful tool to monitor details of Intel CPU
In the research of PCIE 3.0 versus PCIE 4.0, I became serious about the actual application scenario. What’s the real bandwidth between CPU and GPU when we are training a deep learning model? Finally,...
View ArticleHanging of PyTorch’s data loader
Long story short. I am trying to build a Siamese network for audio classification. For 50% possibility, the “dataset.py” will try to find a pair of audios in the same category but with different files...
View ArticleEmpty messages received by PubSub pull()
I want my Python script to receive one message from a PubSub topic and then go on to other work. The code is learned from an example of the GCP document: with subscriber: # The subscriber pulls a...
View ArticleUse a specific service account in the Argo job
I created a simple Argo job to pull messages from a Google Cloud Pub/Sub topic. Permission has been given to the service account of GKE’s workload identity. But the Argo job failed with errors: argo...
View ArticleIntel extension for PyTorch
Trying to test the Intel extension for PyTorch in my project, but it reported errors: Traceback (most recent call last): File "reviewjpgs_optimaztion_testing.py", line 27, in <module> import...
View ArticleExtract only birds sound from audio
This paper introduced a method to extract only segments with bird sound from an audio file. Since the paper didn’t give any code, I started to write it by myself. Here is the Python implementation:...
View ArticleAn incorrect understanding of me for Skip-list
After reading the classic paper about Skip-list, I tried to implement it by myself. But then I found a line of pseudo-code in the “Delete” function that I couldn’t understand: Seems all the elements...
View ArticleSimple Python code of Knapsack Problem
Just write this snippet for my practice of 0-1 Knapsack Problem: values = [1, 2, 3, 4, 5] weights = [3, 2, 1, 9, 6] max_weight = 12 def knappack(): n = len(values) dp = [[0] * (max_weight+1) for _ in...
View ArticleAccelerate augmentation of bird audio
audiomentions is a very convenient library for my bird sound classification. As the code below: from audiomentations import Compose, AddGaussianNoise, AddGaussianSNR, TimeStretch, PitchShift...
View ArticleUsing Javascript to load ONNX model for Object Detection job
Although having used the YOLOv5 model several times, I haven’t used its corresponding ONNX model before. This time, I met a use case to run its ONNX model using Javascript. To learn and debug the...
View ArticleThe experience of using Google Cloud’s Text-to-Speech AI
Just using the Python API of Text-to-Speech AI to transform a PDF file to mp3 audio, as the example: from google.cloud import texttospeech from PyPDF2 import PdfReader client =...
View ArticleInstall new driver for old Nvidia Tesla P100
I was trying to launch a VM instance with GPU on Google Cloud. But after trying T4, L4, and V100, they all reported “exceeding resource limit”, which means a lot of people in my region are using these...
View ArticleTimezone in pods of Argo
Last week I noticed that the pod in Argo would give a UTC timezone even though the Argo configuration has set a AEDT timezone. apiVersion: argoproj.io/v1alpha1 kind: CronWorkflow metadata: name:...
View ArticleInstant Segmentation by YOLOv8
If we want to use YOLOv8 for object detection, here is a good example. What if I want to use YOLOv8 to segment a picture, crop out the object, and paste (only paste the object, not the pixels near it)...
View ArticleTest of SegmentAnything Model (SAM)
Here is the original picture: Months ago, I tested the segmentation of YOLOv8. The result is not very promising: The tail of one monkey couldn’t be segmented correctly. Today I tested the same picture...
View ArticleThe Pub/Sub subscription problem
We have a project using Pub/Sub of Google Cloud. About one month ago, the pipeline failed because the subscription inexplicable disappeared. I suspected someone may mistakenly deleted it. However,...
View ArticleDistributed Data-Parallel training of PyTorch
Let’s get to the point directly: import os import time import torch import torch.nn as nn import torch.distributed as dist from model import resnet152 from dataset import get_data_loaders from...
View ArticleTraining CIFAR-100 by DeepSpeed
deepspeed \ –master_addr=rogpt1 \ –elastic_training \ –min_elastic_nodes=1 \ –max_elastic_nodes=2 \ –hostfile=hostfile \ train.py \ –deepspeed_config ds_config.json deepspeed \ --master_addr=rogpt1 \...
View ArticlePerformance of Flash Attention and torch.compile()
I am trying to build a small repo about multi-modal models (CLIP, ALBEF, BLIP etc). The GPT code is mainly from nanoGPT. Then I became inquisitive about the performance of “Flash Attention” and...
View ArticleMultimodal trials: my tiny CLIP implementation
CLIP is already a three years old paper but its simple design and significant performance still attracted me. After one week of programming and debugging, I finished v0.1-version of my tiny CLIP. It...
View Article