feat: 完成作业1-4 - LLAISYS 全链路实现及 CUDA 集成 - #55
Open
1203153267-boop wants to merge 1 commit into
Open
Conversation
作业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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
作业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