mirror of
https://github.com/karpathy/llm.c.git
synced 2026-07-28 20:35:09 -04:00
Merge pull request #398 from zwets/fix-cudnn-frontend-check
Fix detection of cudnn-frontend in '.' on Linux
This commit is contained in:
commit
923b2b0a8f
2 changed files with 5 additions and 7 deletions
10
Makefile
10
Makefile
|
|
@ -19,8 +19,7 @@ NVCC_INCLUDES =
|
|||
NVCC_LDLIBS =
|
||||
NCLL_INCUDES =
|
||||
NVCC_CUDNN =
|
||||
# overridable flag for multi-GPU training. by default we won't build with cudnn
|
||||
# because it bloats up the compile time from a few seconds to ~minute
|
||||
# By default we don't build with cudnn because it blows up compile time from a few seconds to ~minute
|
||||
USE_CUDNN ?= 0
|
||||
|
||||
# Function to check if a file exists in the PATH
|
||||
|
|
@ -86,16 +85,15 @@ else
|
|||
endif
|
||||
|
||||
# Check and include cudnn if available
|
||||
# You can override the path to cudnn frontend by setting CUDNN_FRONTEND_PATH=your_path on the make command line
|
||||
# You can override the path to cudnn frontend by setting CUDNN_FRONTEND_PATH on the make command line
|
||||
# By default, we look for it in HOME/cudnn-frontend/include and ./cudnn-frontend/include
|
||||
# Refer to the README for cuDNN install instructions
|
||||
ifeq ($(USE_CUDNN), 1)
|
||||
ifeq ($(SHELL_UNAME), Linux)
|
||||
# hard-coded path for now in either . or ($HOME) directory
|
||||
# this can be overridden by setting CUDNN_FRONTEND_PATH on the command line
|
||||
ifeq ($(shell [ -d $(HOME)/cudnn-frontend/include ] && echo "exists"), exists)
|
||||
$(info ✓ cuDNN found, will run with flash-attention)
|
||||
CUDNN_FRONTEND_PATH ?= $(HOME)/cudnn-frontend/include
|
||||
else ifeq ($(shell [ -d cudnn-frontend/include ] && echo "exists"),)
|
||||
else ifeq ($(shell [ -d cudnn-frontend/include ] && echo "exists"), exists)
|
||||
$(info ✓ cuDNN found, will run with flash-attention)
|
||||
CUDNN_FRONTEND_PATH ?= cudnn-frontend/include
|
||||
else
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ sudo apt-get update
|
|||
sudo apt-get -y install libcudnn9-dev-cuda-12
|
||||
```
|
||||
|
||||
On top of this you need the [cuDNN frontend](https://github.com/NVIDIA/cudnn-frontend/tree/main), but this is just header files. So simply download the repo to your disk, currently assumed to be in your home directory (i.e. the Makefile looks for `~/cudnn-frontend/include`).
|
||||
On top of this you need the [cuDNN frontend](https://github.com/NVIDIA/cudnn-frontend/tree/main), but this is just header files. Simply clone the repo to your disk. The Makefile currently looks for it in either your home directory or the current directory. If you have put it elsewhere, add `CUDNN_FRONTEND_PATH=/path/to/your/cudnn-frontend/include` to the `make` command-line.
|
||||
|
||||
**Multi-GPU training**. As of April 26, 2024 there is now also support for multi-GPU training using MPI and NCCL. Make sure you install MPI, e.g. on Linux:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue