LeetCode: 242-Valid Anagram Solution
Problem
Given two strings s and t, return true if t is an anagram of s, and false otherwise.
Given two strings s and t, return true if t is an anagram of s, and false otherwise.
You are given the array paths, where paths[i] = [cityAi, cityBi] means there exists a direct path going from cityAi to cityBi. Return the destination city, that is, the city without any path outgoing to another city.
vLLM is a large language model (LLM) acceleration framework that developed by the research team of University of California, Berkeley. It is used PagedAttention to increase the usage rate of GPU VRAM, and this method do not change the model architecture.
Read More »Using vLLM To Accelerate The Decoding Of Large Language ModelLast night I tried to improve some code about merge two models. Because my poor device, I cannot merge all layers totally, but need to merge them layer by layer for reducing my memory cost.
Read More »[PyTorch] Delete Model And Free Memory (GPU / CPU)Given the root of a binary tree, construct a string consisting of parenthesis and integers from a binary tree with the preorder traversal way, and return it.
You are given a string num, representing a large integer. Return the largest-valued odd integer (as a string) that is a non-empty substring of num, or an empty string "" if no odd integer exists.
In early 2023, The pytorch 2.0 version added a new function that is torch.compile(), It cloud be accelerate the speed of model training or inference. By using precision training with compiling, it always make my training time reduce to half.
Today I tried to load the model weights file after torch.compile(), and then I found the weights is stored by OrderedDict data structure. This data structure is an ordered sequence, in other word its content needs to follow the order.
yield is a keyword in Python, utilized much like return, the use of yield transforms a function into a Generator.
FastAPI is a modern, high-performance Python web framework. It is based on Python 3.7+ and utilizes Python type hints.
Read More »[Python] Notes on Backend Development Using the FastAPI Framework