‹ Reports
The Dispatch

OSS Report: karpathy/llm.c


CUDA Compatibility Issues Persist in karpathy/llm.c Project Amidst Active Development

The karpathy/llm.c project, focused on efficient training of large language models using C/CUDA, continues to face challenges with CUDA compatibility and multi-GPU setups, as evidenced by ongoing issues. The project aims to provide a lightweight alternative to frameworks like PyTorch, emphasizing simplicity and performance.

Recent Activity

Recent issues highlight persistent CUDA-related errors, such as "no CUDA-capable device is detected" and "illegal memory access," suggesting ongoing compatibility or configuration problems. Multi-GPU training hangs further indicate synchronization or resource allocation issues. Notable recent issues include #739 (suggestion for testing more activation functions) and #729 (MPI run error), reflecting user interest in enhancing functionality and resolving technical hurdles.

Development Team and Activities

Recent Pull Requests

  1. #743: Fixed modal script for updated cudnn version.
  2. #742: Improved reliability by checking libnccl instead of nccl.
  3. #741: Initial curand implementation for model initialization.
  4. #737: Multi-threaded model initialization to improve startup time.
  5. #734: Added external KV support for LLaMA 3.

These activities indicate a focus on performance optimization, feature expansion, and reliability improvements, with significant community engagement contributing to the project's adaptability across different computational frameworks.

Of Note

Quantified Reports

Quantify commits



Quantified Commit Activity Over 30 Days

Developer Avatar Branches PRs Commits Files Changes
Aleksa Gordić 1 11/3/2 47 16 5882
Andrej 2 4/3/0 11 11 1464
Erik Schultheis 1 4/3/0 9 5 245
indianspeedster 1 1/1/0 2 2 203
Aroun Demeure 1 5/2/1 8 3 191
Massimiliano Pronesti 1 2/2/0 3 7 75
Ross Wheeler 1 1/1/0 2 3 6
Li Deng 1 2/1/0 1 1 2
Yuchen Jin 1 1/1/0 1 1 2
Madan Bahadur khadka (Madankh) 0 1/0/1 0 0 0
Vyom Sharma (vyom1611) 0 1/0/1 0 0 0
Biao Zhang (zhangpiu) 0 2/0/1 0 0 0
Yusong Gao (GaoYusong) 0 1/0/0 0 0 0
Furkan Sahin (furkansahin) 0 1/0/1 0 0 0
Varun Ganapathi (varun-a10ai) 0 1/0/0 0 0 0
almao (invisiblepancake) 0 1/0/0 0 0 0

PRs: created by that dev and opened/merged/closed-unmerged during the period

Quantify Issues



Recent GitHub Issues Activity

Timespan Opened Closed Comments Labeled Milestones
7 Days 1 0 0 1 1
30 Days 7 1 3 7 1
90 Days 28 14 64 27 1
All Time 129 60 - - -

Like all software activity quantification, these numbers are imperfect but sometimes useful. Comments, Labels, and Milestones refer to those issues opened in the timespan in question.

Detailed Reports

Report On: Fetch issues



Recent Activity Analysis

The karpathy/llm.c repository has seen a variety of activities, with 69 open issues currently. Recent issues highlight a focus on CUDA-related errors, compatibility concerns, and feature requests for broader hardware support. Notable anomalies include persistent CUDA errors such as "no CUDA-capable device is detected" and "illegal memory access," indicating potential compatibility or configuration issues. Additionally, discussions around multi-GPU training hanging suggest synchronization or resource allocation problems. Themes among the issues include hardware compatibility, performance optimization, and requests for additional features like support for different activation functions and hardware platforms.

Issue Details

Most Recently Created Issues

  • #739: Suggestion: Test more Activation Functions

    • Priority: Low
    • Status: Open
    • Created: 6 days ago
  • #729: MPI run error

    • Priority: High
    • Status: Open
    • Created: 10 days ago

Most Recently Updated Issues

  • #63: the provided PTX was compiled with an unsupported toolchain

    • Priority: High
    • Status: Open
    • Created: 129 days ago
    • Updated: Today
  • #31: Why CUDA when we can SYCL

    • Priority: Medium
    • Status: Open
    • Created: 131 days ago
    • Updated: 2 days ago

Important Issues

  • #727: MPI run with 8 GPU fails

    • Priority: High
    • Status: Open
    • Created: 15 days ago
  • #723: TypeError: normal_() got an unexpected keyword argument 'generator'

    • Priority: Medium
    • Status: Open
    • Created: 16 days ago

These issues reflect ongoing challenges with hardware compatibility and software dependencies, particularly in multi-GPU configurations and CUDA environments. The community's engagement with these issues indicates a strong interest in resolving technical hurdles to improve the project's robustness and accessibility across different platforms.

Report On: Fetch pull requests



Overview

The karpathy/llm.c repository is a project focused on training large language models using simple, raw C/CUDA code. The repository emphasizes efficiency and simplicity, providing an alternative to heavier frameworks like PyTorch. It supports multi-GPU and multi-node setups and has gained significant attention in the developer community.

Summary of Pull Requests

  1. #743: Fixed modal script for updated cudnn version and read errors. Commented out problematic fread_check and updated cudnn version.
  2. #742: Improved reliability by checking libnccl instead of nccl.
  3. #741: Initial curand implementation for model initialization, still work-in-progress.
  4. #737: Multi-threaded model initialization to improve startup time.
  5. #735: Minor refactor for LLaMA 3.
  6. #734: Added external KV support for LLaMA 3.
  7. #733: Added llm.cpp port using Eigen library, supporting CPU/CUDA.
  8. #731: Merged master branch into a fork.
  9. #728: Added train_llama31.py for LLaMA 3.1 training and finetuning.
  10. #724: Added llm.cpp fork featuring tinytorch.hpp library.
  11. #721: Faster GELU forward & backward using MUFU.TANH for SM7.5+.
  12. #718: Added SwiGLU support with increased memory footprint.
  13. #714: Implemented RoPE positional encoding from RoFormer paper.
  14. #711: Improved outlier detection in gradient updates.
  15. #708: Added high-performance mode with warnings for suboptimal branches.
  16. #707: Added KV cache for inference with significant speedup.
  17. #704: Added batch limit to prevent infinite loop in 124M script.
  18. #699: Simplified/faster "backward bias" kernel with column reduction.

Analysis of Pull Requests

The recent pull requests reflect a strong focus on performance optimization, feature expansion, and reliability improvements within the karpathy/llm.c project.

Performance Optimization

Several pull requests are dedicated to enhancing performance, particularly on GPU architectures:

  • PR #721 introduces faster GELU kernels leveraging hardware instructions specific to NVIDIA's Turing architecture, showing significant speed improvements in backward passes.
  • PR #707 implements a KV cache for inference, achieving up to a 12x speedup for larger models by optimizing memory access patterns during generation tasks.

Feature Expansion

The repository continues to expand its feature set to support more complex and varied model architectures:

  • PR #734 and #735 enhance the LLaMA 3 capabilities by adding external key-value support and minor refactors, ensuring the project remains competitive with state-of-the-art models.
  • PR #718 introduces SwiGLU activation functions from recent research, although it notes an increase in memory usage as a trade-off.

Reliability Improvements

Efforts to improve the robustness of the codebase are evident:

  • PR #742 addresses potential issues in dependency checks by improving the reliability of NCCL detection, which is crucial for multi-GPU setups.
  • PR #711 enhances outlier detection mechanisms to improve training stability, particularly important when scaling up model sizes or batch processing.

Community Contributions

The project benefits from active community engagement, as seen in contributions like PR #733, which adds a new port using the Eigen library, demonstrating the project's adaptability across different computational frameworks.

Overall, the pull requests indicate a balanced approach to maintaining cutting-edge performance while expanding functionality and ensuring code reliability. The project's open-source nature and collaborative environment continue to foster innovation and improvement from both core contributors and the broader community.

Report On: Fetch commits



Development Team and Recent Activity

Team Members and Activities

  • Andrej (karpathy)

    • Recent commits include typo fixes, feature additions, and improvements in memory management and multi-GPU setups.
    • Collaborated with Aleksa Gordić, Erik Schultheis, and others on various features like dataloader fixes and compile time improvements.
  • Erik Schultheis (ngc92)

    • Worked on memory management improvements, GPU logging configurations, and added temperature control features.
    • Collaborated with Andrej on several pull requests.
  • Li Deng (dengl11)

    • Fixed a typo in profile_gpt2cu.py.
  • Aleksa Gordić (gordicaleksa)

    • Major contributor with numerous commits focused on refactoring, adding LLaMA 3 support, improving data loaders, and enhancing compile times.
    • Collaborated extensively with Andrej on multiple branches.
  • Aroun Demeure (ademeure)

    • Improved compile times and memory allocation strategies.
    • Worked on making cuDNN deterministic for Flash Attention backward.
  • Massimiliano Pronesti (mspronesti)

    • Addressed memory leaks in CUDA code and improved validation/benchmarking utilities.
  • Shekhar (indianspeedster)

    • Added compilation steps for CUDA kernels and fixed bugs related to merge conflicts.
  • Ross Wheeler (rosslwheeler)

    • Added CI checks for loss tolerance and contributed to CUDA compatibility improvements.
  • Yuchen Jin (YuchenJin)

    • Fixed integer overflow issues by updating parameter size types.

Patterns and Themes

  1. Collaboration: There is significant collaboration among team members, especially between Andrej and other contributors like Aleksa Gordić and Erik Schultheis. This is evident from the numerous merged pull requests involving multiple developers.

  2. Focus on Performance: Recent activities emphasize performance improvements, such as optimizing memory allocation, improving compile times, and enhancing multi-GPU support.

  3. Refactoring and Bug Fixes: A considerable amount of work has been dedicated to refactoring existing code for better maintainability and fixing bugs to ensure stability.

  4. Feature Expansion: The team is actively working on expanding the project's capabilities, including support for new models like LLaMA 3 and adding new functionalities such as learning rate schedulers.

  5. Continuous Integration: There is an ongoing effort to integrate CI/CD practices, as seen in the addition of CI checks for loss tolerance by Ross Wheeler.

Overall, the development team is actively engaged in enhancing the functionality, performance, and reliability of the karpathy/llm.c project through collaborative efforts.