Skip to content

feat: 完成作业1-4 - LLAISYS 全链路实现及 CUDA 集成 - #55

Open
1203153267-boop wants to merge 1 commit into
InfiniTensor:mainfrom
1203153267-boop:assignment
Open

feat: 完成作业1-4 - LLAISYS 全链路实现及 CUDA 集成#55
1203153267-boop wants to merge 1 commit into
InfiniTensor:mainfrom
1203153267-boop:assignment

Conversation

@1203153267-boop

Copy link
Copy Markdown

作业1 (Tensor):
实现张量基础操作 - load / view / permute / slice
测试: test_tensor.py --device cpu - Passed

作业2 (Ops):
实现 CPU 版本算子 - add / rms_norm / rope / self_attention / swiglu / linear / embedding / argmax 测试: 全部算子 test/ops/*.py --device cpu - Passed

作业3 (LLM推理):
基于作业2的算子,用 C++ 实现 Qwen2 模型推理(embedding + 28层Transformer + lm_head) Python 端加载 safetensors 权重,C++ 端完成前向计算和 argmax 采样
测试: test_infer.py --test - Passed(与 PyTorch 输出一致)

作业4 (CUDA集成):
实现 CUDA Runtime API(nvidia_runtime_api.cu)
为 7 个算子实现 CUDA 版本(add / rms_norm / linear / embedding / argmax / swiglu / rope) 配置 xmake 编译系统(nvidia.lua + build_nvidia.cmd)
模型推理支持 --device nvidia
测试: test_infer.py --test --device nvidia - Test passed!

平台: NVIDIA GeForce RTX 4070 Laptop GPU / CUDA 12.9 / Python 3.10 / PyTorch 2.13

作业1 (Tensor):
实现张量基础操作 - load / view / permute / slice
测试: test_tensor.py --device cpu - Passed

作业2 (Ops):
实现 CPU 版本算子 - add / rms_norm / rope / self_attention / swiglu / linear / embedding / argmax
测试: 全部算子 test/ops/*.py --device cpu - Passed

作业3 (LLM推理):
基于作业2的算子,用 C++ 实现 Qwen2 模型推理(embedding + 28层Transformer + lm_head)
Python 端加载 safetensors 权重,C++ 端完成前向计算和 argmax 采样
测试: test_infer.py --test - Passed(与 PyTorch 输出一致)

作业4 (CUDA集成):
实现 CUDA Runtime API(nvidia_runtime_api.cu)
为 7 个算子实现 CUDA 版本(add / rms_norm / linear / embedding / argmax / swiglu / rope)
配置 xmake 编译系统(nvidia.lua + build_nvidia.cmd)
模型推理支持 --device nvidia
测试: test_infer.py --test --device nvidia - Test passed!

平台: NVIDIA GeForce RTX 4070 Laptop GPU / CUDA 12.9 / Python 3.10 / PyTorch 2.13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant