mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-31 08:51:55 +00:00 
			
		
		
		
	devops : add intel oneapi dockerfile (#5068)
Co-authored-by: Xuan Son Nguyen <xuanson.nguyen@snowpack.eu>
This commit is contained in:
		
							
								
								
									
										26
									
								
								.devops/main-intel.Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								.devops/main-intel.Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| ARG ONEAPI_VERSION=2024.0.1-devel-ubuntu22.04 | ||||
| ARG UBUNTU_VERSION=22.04 | ||||
|  | ||||
| FROM intel/hpckit:$ONEAPI_VERSION as build | ||||
|  | ||||
| RUN apt-get update && \ | ||||
|     apt-get install -y git | ||||
|  | ||||
| WORKDIR /app | ||||
|  | ||||
| COPY . . | ||||
|  | ||||
| # for some reasons, "-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=Intel10_64lp -DLLAMA_NATIVE=ON" give worse performance | ||||
| RUN mkdir build && \ | ||||
|     cd build && \ | ||||
|     cmake .. -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx && \ | ||||
|     cmake --build . --config Release --target main server | ||||
|  | ||||
| FROM ubuntu:$UBUNTU_VERSION as runtime | ||||
|  | ||||
| COPY --from=build /app/build/bin/main /main | ||||
| COPY --from=build /app/build/bin/server /server | ||||
|  | ||||
| ENV LC_ALL=C.utf8 | ||||
|  | ||||
| ENTRYPOINT [ "/main" ] | ||||
							
								
								
									
										1
									
								
								.github/workflows/docker.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/workflows/docker.yml
									
									
									
									
										vendored
									
									
								
							| @@ -35,6 +35,7 @@ jobs: | ||||
|           - { tag: "full-cuda", dockerfile: ".devops/full-cuda.Dockerfile", platforms: "linux/amd64" } | ||||
|           - { tag: "light-rocm", dockerfile: ".devops/main-rocm.Dockerfile", platforms: "linux/amd64,linux/arm64" } | ||||
|           - { tag: "full-rocm", dockerfile: ".devops/full-rocm.Dockerfile", platforms: "linux/amd64,linux/arm64" } | ||||
|           - { tag: "light-intel", dockerfile: ".devops/main-intel.Dockerfile", platforms: "linux/amd64" } | ||||
|     steps: | ||||
|       - name: Check out the repo | ||||
|         uses: actions/checkout@v3 | ||||
|   | ||||
| @@ -478,6 +478,11 @@ function(get_flags CCID CCVER) | ||||
|         if (CCVER VERSION_GREATER_EQUAL 8.1.0) | ||||
|             set(CXX_FLAGS ${CXX_FLAGS} -Wextra-semi) | ||||
|         endif() | ||||
|     elseif (CCID MATCHES "Intel") | ||||
|         # enable max optimization level when using Intel compiler | ||||
|         set(C_FLAGS   -ipo -O3 -static -fp-model=fast -flto -fno-stack-protector) | ||||
|         set(CXX_FLAGS -ipo -O3 -static -fp-model=fast -flto -fno-stack-protector) | ||||
|         add_link_options(-fuse-ld=lld -static-intel) | ||||
|     endif() | ||||
|  | ||||
|     set(GF_C_FLAGS   ${C_FLAGS}   PARENT_SCOPE) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Xuan Son Nguyen
					Xuan Son Nguyen