Skip to content

Instantly share code, notes, and snippets.

View YuehChuan's full-sized avatar

YuehChuan YuehChuan

  • Taiwan
  • 09:42 (UTC +08:00)
View GitHub Profile
@YuehChuan
YuehChuan / CMakeLists.txt
Created April 21, 2021 13:55 — forked from tdenewiler/CMakeLists.txt
ROS Synchronization Example
cmake_minimum_required(VERSION 2.8.3)
project(sync_example)
find_package(catkin REQUIRED COMPONENTS message_filters roscpp sensor_msgs)
catkin_package(
CATKIN_DEPENDS message_filters roscpp sensor_msgs
)
include_directories(${catkin_INCLUDE_DIRS})
@YuehChuan
YuehChuan / gist:1daab7c49828d925294e4dd9eb813e42
Created October 27, 2023 00:04
nn.embedding backward grad
import torch
import torch.nn as nn
# an Embedding module containing 10 tensors of size 3
embedding = nn.Embedding(6, 3)
# a batch of 2 samples of 3 elements each
input = torch.LongTensor([[1, 2, 3],[0,2,3]])
loss=torch.sum(embedding(input))
print("embedding" )
print(embedding.weight )
@YuehChuan
YuehChuan / gist:727e11019449b73513be5116296db022
Last active April 19, 2025 08:39
DeepSeek-R1 FUll version on 16X H100
export GLOO_SOCKET_IFNAME=net1
python3 -m sglang.launch_server --model <model_name> --port 8000 --tp 16 --dist-init-addr <node1_ip>:6379 --nnodes 2 --node-rank 0 --trust-remote-code --host 0.0.0.0
python3 -m sglang.launch_server --model <model_name> --port 8000 --tp 16 --dist-init-addr <node1_ip>:6379 --nnodes 2 --node-rank 0 --trust-remote-code --host 0.0.0.0
export GLOO_SOCKET_IFNAME=<ifname>
python3 -m sglang.launch_server --model <model_name> --port 8000 --tp 16 --dist-init-addr <node1_ip>:6379 --nnodes 2 --node-rank 1 --trust-remote-code --host 0.0.0.0