gen_windows.ps1 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. #!powershell
  2. function amdGPUs {
  3. if ($env:AMDGPU_TARGETS) {
  4. return $env:AMDGPU_TARGETS
  5. }
  6. # TODO - load from some common data file for linux + windows build consistency
  7. $GPU_LIST = @(
  8. "gfx900"
  9. "gfx906:xnack-"
  10. "gfx908:xnack-"
  11. "gfx90a:xnack+"
  12. "gfx90a:xnack-"
  13. "gfx940"
  14. "gfx941"
  15. "gfx942"
  16. "gfx1010"
  17. "gfx1012"
  18. "gfx1030"
  19. "gfx1100"
  20. "gfx1101"
  21. "gfx1102"
  22. )
  23. $GPU_LIST -join ';'
  24. }
  25. function init_vars {
  26. if (!$script:SRC_DIR) {
  27. $script:SRC_DIR = $(resolve-path "..\..\")
  28. }
  29. if (!$script:llamacppDir) {
  30. $script:llamacppDir = "../llama.cpp"
  31. }
  32. if (!$script:cmakeTargets) {
  33. $script:cmakeTargets = @("ollama_llama_server")
  34. }
  35. $script:cmakeDefs = @(
  36. "-DBUILD_SHARED_LIBS=on",
  37. "-DLLAMA_NATIVE=off"
  38. )
  39. $script:commonCpuDefs = @("-DCMAKE_POSITION_INDEPENDENT_CODE=on")
  40. $script:ARCH = $Env:PROCESSOR_ARCHITECTURE.ToLower()
  41. $script:DIST_BASE = "${script:SRC_DIR}\dist\windows-${script:ARCH}\ollama_runners"
  42. md "$script:DIST_BASE" -ea 0 > $null
  43. if ($env:CGO_CFLAGS -contains "-g") {
  44. $script:cmakeDefs += @("-DCMAKE_VERBOSE_MAKEFILE=on", "-DLLAMA_SERVER_VERBOSE=on", "-DCMAKE_BUILD_TYPE=RelWithDebInfo")
  45. $script:config = "RelWithDebInfo"
  46. } else {
  47. $script:cmakeDefs += @("-DLLAMA_SERVER_VERBOSE=off", "-DCMAKE_BUILD_TYPE=Release")
  48. $script:config = "Release"
  49. }
  50. if ($null -ne $env:CMAKE_SYSTEM_VERSION) {
  51. $script:cmakeDefs += @("-DCMAKE_SYSTEM_VERSION=${env:CMAKE_SYSTEM_VERSION}")
  52. }
  53. # Try to find the CUDA dir
  54. if ($env:CUDA_LIB_DIR -eq $null) {
  55. $d=(get-command -ea 'silentlycontinue' nvcc).path
  56. if ($d -ne $null) {
  57. $script:CUDA_LIB_DIR=($d| split-path -parent)
  58. $script:CUDA_INCLUDE_DIR=($script:CUDA_LIB_DIR|split-path -parent)+"\include"
  59. }
  60. } else {
  61. $script:CUDA_LIB_DIR=$env:CUDA_LIB_DIR
  62. }
  63. $script:DUMPBIN=(get-command -ea 'silentlycontinue' dumpbin).path
  64. if ($null -eq $env:CMAKE_CUDA_ARCHITECTURES) {
  65. $script:CMAKE_CUDA_ARCHITECTURES="50;52;61;70;75;80"
  66. } else {
  67. $script:CMAKE_CUDA_ARCHITECTURES=$env:CMAKE_CUDA_ARCHITECTURES
  68. }
  69. # Note: Windows Kits 10 signtool crashes with GCP's plugin
  70. if ($null -eq $env:SIGN_TOOL) {
  71. ${script:SignTool}="C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe"
  72. } else {
  73. ${script:SignTool}=${env:SIGN_TOOL}
  74. }
  75. if ("${env:KEY_CONTAINER}") {
  76. ${script:OLLAMA_CERT}=$(resolve-path "${script:SRC_DIR}\ollama_inc.crt")
  77. }
  78. }
  79. function git_module_setup {
  80. # TODO add flags to skip the init/patch logic to make it easier to mod llama.cpp code in-repo
  81. & git submodule init
  82. if ($LASTEXITCODE -ne 0) { throw($LASTEXITCODE)}
  83. & git submodule update --force "${script:llamacppDir}"
  84. if ($LASTEXITCODE -ne 0) { throw($LASTEXITCODE)}
  85. }
  86. function apply_patches {
  87. # Wire up our CMakefile
  88. if (!(Select-String -Path "${script:llamacppDir}/CMakeLists.txt" -Pattern 'ollama')) {
  89. Add-Content -Path "${script:llamacppDir}/CMakeLists.txt" -Value 'add_subdirectory(../ext_server ext_server) # ollama'
  90. }
  91. # Apply temporary patches until fix is upstream
  92. $patches = Get-ChildItem "../patches/*.diff"
  93. foreach ($patch in $patches) {
  94. # Extract file paths from the patch file
  95. $filePaths = Get-Content $patch.FullName | Where-Object { $_ -match '^\+\+\+ ' } | ForEach-Object {
  96. $parts = $_ -split ' '
  97. ($parts[1] -split '/', 2)[1]
  98. }
  99. # Checkout each file
  100. foreach ($file in $filePaths) {
  101. git -C "${script:llamacppDir}" checkout $file
  102. }
  103. }
  104. # Apply each patch
  105. foreach ($patch in $patches) {
  106. git -C "${script:llamacppDir}" apply $patch.FullName
  107. }
  108. }
  109. function build {
  110. write-host "generating config with: cmake -S ${script:llamacppDir} -B $script:buildDir $script:cmakeDefs"
  111. & cmake --version
  112. & cmake -S "${script:llamacppDir}" -B $script:buildDir $script:cmakeDefs
  113. if ($LASTEXITCODE -ne 0) { throw($LASTEXITCODE)}
  114. if ($cmakeDefs -contains "-G") {
  115. $extra=@("-j8")
  116. } else {
  117. $extra= @("--", "/p:CL_MPcount=8")
  118. }
  119. write-host "building with: cmake --build $script:buildDir --config $script:config $($script:cmakeTargets | ForEach-Object { `"--target`", $_ }) $extra"
  120. & cmake --build $script:buildDir --config $script:config ($script:cmakeTargets | ForEach-Object { "--target", $_ }) $extra
  121. if ($LASTEXITCODE -ne 0) { write-host "cmake build exit status $LASTEXITCODE"; throw($LASTEXITCODE)}
  122. # Rearrange output to be consistent between different generators
  123. if ($null -ne ${script:config} -And (test-path -path "${script:buildDir}/bin/${script:config}" ) ) {
  124. mv -force "${script:buildDir}/bin/${script:config}/*" "${script:buildDir}/bin/"
  125. remove-item "${script:buildDir}/bin/${script:config}"
  126. }
  127. }
  128. function sign {
  129. if ("${env:KEY_CONTAINER}") {
  130. write-host "Signing ${script:buildDir}/bin/*.exe ${script:buildDir}/bin/*.dll"
  131. foreach ($file in @(get-childitem "${script:buildDir}/bin/*.exe") + @(get-childitem "${script:buildDir}/bin/*.dll")){
  132. & "${script:SignTool}" sign /v /fd sha256 /t http://timestamp.digicert.com /f "${script:OLLAMA_CERT}" `
  133. /csp "Google Cloud KMS Provider" /kc "${env:KEY_CONTAINER}" $file
  134. if ($LASTEXITCODE -ne 0) { throw($LASTEXITCODE)}
  135. }
  136. }
  137. }
  138. function install {
  139. write-host "Installing binaries to dist dir ${script:distDir}"
  140. mkdir ${script:distDir} -ErrorAction SilentlyContinue
  141. $binaries = dir "${script:buildDir}/bin/*.exe"
  142. foreach ($file in $binaries) {
  143. copy-item -Path $file -Destination ${script:distDir} -Force
  144. }
  145. write-host "Installing dlls to dist dir ${script:distDir}"
  146. $dlls = dir "${script:buildDir}/bin/*.dll"
  147. foreach ($file in $dlls) {
  148. copy-item -Path $file -Destination ${script:distDir} -Force
  149. }
  150. }
  151. function cleanup {
  152. $patches = Get-ChildItem "../patches/*.diff"
  153. foreach ($patch in $patches) {
  154. # Extract file paths from the patch file
  155. $filePaths = Get-Content $patch.FullName | Where-Object { $_ -match '^\+\+\+ ' } | ForEach-Object {
  156. $parts = $_ -split ' '
  157. ($parts[1] -split '/', 2)[1]
  158. }
  159. # Checkout each file
  160. foreach ($file in $filePaths) {
  161. git -C "${script:llamacppDir}" checkout $file
  162. }
  163. git -C "${script:llamacppDir}" checkout CMakeLists.txt
  164. }
  165. }
  166. # -DLLAMA_AVX -- 2011 Intel Sandy Bridge & AMD Bulldozer
  167. # -DLLAMA_AVX2 -- 2013 Intel Haswell & 2015 AMD Excavator / 2017 AMD Zen
  168. # -DLLAMA_FMA (FMA3) -- 2013 Intel Haswell & 2012 AMD Piledriver
  169. function build_static() {
  170. if ((-not "${env:OLLAMA_SKIP_STATIC_GENERATE}") -and ((-not "${env:OLLAMA_CPU_TARGET}") -or ("${env:OLLAMA_CPU_TARGET}" -eq "static"))) {
  171. # GCC build for direct linking into the Go binary
  172. init_vars
  173. # cmake will silently fallback to msvc compilers if mingw isn't in the path, so detect and fail fast
  174. # as we need this to be compiled by gcc for golang to be able to link with itx
  175. write-host "Checking for MinGW..."
  176. # error action ensures we exit on failure
  177. get-command gcc
  178. get-command mingw32-make
  179. $oldTargets = $script:cmakeTargets
  180. $script:cmakeTargets = @("llama", "ggml")
  181. $script:cmakeDefs = @(
  182. "-G", "MinGW Makefiles"
  183. "-DCMAKE_C_COMPILER=gcc.exe",
  184. "-DCMAKE_CXX_COMPILER=g++.exe",
  185. "-DBUILD_SHARED_LIBS=off",
  186. "-DLLAMA_NATIVE=off",
  187. "-DLLAMA_AVX=off",
  188. "-DLLAMA_AVX2=off",
  189. "-DLLAMA_AVX512=off",
  190. "-DLLAMA_F16C=off",
  191. "-DLLAMA_FMA=off")
  192. $script:buildDir="../build/windows/${script:ARCH}_static"
  193. write-host "Building static library"
  194. build
  195. $script:cmakeTargets = $oldTargets
  196. } else {
  197. write-host "Skipping CPU generation step as requested"
  198. }
  199. }
  200. function build_cpu() {
  201. if ($script:ARCH -eq "arm64") {
  202. $gen_arch = "ARM64"
  203. } else { # amd64
  204. $gen_arch = "x64"
  205. }
  206. if ((-not "${env:OLLAMA_SKIP_CPU_GENERATE}" ) -and ((-not "${env:OLLAMA_CPU_TARGET}") -or ("${env:OLLAMA_CPU_TARGET}" -eq "cpu"))) {
  207. # remaining llama.cpp builds use MSVC
  208. init_vars
  209. $script:cmakeDefs = $script:commonCpuDefs + @("-A", $gen_arch, "-DLLAMA_AVX=off", "-DLLAMA_AVX2=off", "-DLLAMA_AVX512=off", "-DLLAMA_FMA=off", "-DLLAMA_F16C=off") + $script:cmakeDefs
  210. $script:buildDir="../build/windows/${script:ARCH}/cpu"
  211. $script:distDir="$script:DIST_BASE\cpu"
  212. write-host "Building LCD CPU"
  213. build
  214. sign
  215. install
  216. } else {
  217. write-host "Skipping CPU generation step as requested"
  218. }
  219. }
  220. function build_cpu_avx() {
  221. if ((-not "${env:OLLAMA_SKIP_CPU_GENERATE}" ) -and ((-not "${env:OLLAMA_CPU_TARGET}") -or ("${env:OLLAMA_CPU_TARGET}" -eq "cpu_avx"))) {
  222. init_vars
  223. $script:cmakeDefs = $script:commonCpuDefs + @("-A", "x64", "-DLLAMA_AVX=on", "-DLLAMA_AVX2=off", "-DLLAMA_AVX512=off", "-DLLAMA_FMA=off", "-DLLAMA_F16C=off") + $script:cmakeDefs
  224. $script:buildDir="../build/windows/${script:ARCH}/cpu_avx"
  225. $script:distDir="$script:DIST_BASE\cpu_avx"
  226. write-host "Building AVX CPU"
  227. build
  228. sign
  229. install
  230. } else {
  231. write-host "Skipping CPU AVX generation step as requested"
  232. }
  233. }
  234. function build_cpu_avx2() {
  235. if ((-not "${env:OLLAMA_SKIP_CPU_GENERATE}" ) -and ((-not "${env:OLLAMA_CPU_TARGET}") -or ("${env:OLLAMA_CPU_TARGET}" -eq "cpu_avx2"))) {
  236. init_vars
  237. $script:cmakeDefs = $script:commonCpuDefs + @("-A", "x64", "-DLLAMA_AVX=on", "-DLLAMA_AVX2=on", "-DLLAMA_AVX512=off", "-DLLAMA_FMA=on", "-DLLAMA_F16C=on") + $script:cmakeDefs
  238. $script:buildDir="../build/windows/${script:ARCH}/cpu_avx2"
  239. $script:distDir="$script:DIST_BASE\cpu_avx2"
  240. write-host "Building AVX2 CPU"
  241. build
  242. sign
  243. install
  244. } else {
  245. write-host "Skipping CPU AVX2 generation step as requested"
  246. }
  247. }
  248. function build_cuda() {
  249. if ((-not "${env:OLLAMA_SKIP_CUDA_GENERATE}") -and ("${script:CUDA_LIB_DIR}")) {
  250. # Then build cuda as a dynamically loaded library
  251. $nvcc = "$script:CUDA_LIB_DIR\nvcc.exe"
  252. $script:CUDA_VERSION=(get-item ($nvcc | split-path | split-path)).Basename
  253. if ($null -ne $script:CUDA_VERSION) {
  254. $script:CUDA_VARIANT="_"+$script:CUDA_VERSION
  255. }
  256. init_vars
  257. $script:buildDir="../build/windows/${script:ARCH}/cuda$script:CUDA_VARIANT"
  258. $script:distDir="$script:DIST_BASE\cuda$script:CUDA_VARIANT"
  259. $script:cmakeDefs += @(
  260. "-A", "x64",
  261. "-DLLAMA_CUDA=ON",
  262. "-DLLAMA_AVX=on",
  263. "-DLLAMA_AVX2=off",
  264. "-DCUDAToolkit_INCLUDE_DIR=$script:CUDA_INCLUDE_DIR",
  265. "-DCMAKE_CUDA_FLAGS=-t8"
  266. "-DCMAKE_CUDA_ARCHITECTURES=${script:CMAKE_CUDA_ARCHITECTURES}"
  267. )
  268. if ($null -ne $env:OLLAMA_CUSTOM_CUDA_DEFS) {
  269. write-host "OLLAMA_CUSTOM_CUDA_DEFS=`"${env:OLLAMA_CUSTOM_CUDA_DEFS}`""
  270. $script:cmakeDefs +=@("${env:OLLAMA_CUSTOM_CUDA_DEFS}")
  271. write-host "building custom CUDA GPU"
  272. }
  273. build
  274. sign
  275. install
  276. write-host "copying CUDA dependencies to ${script:SRC_DIR}\dist\windows-${script:ARCH}\"
  277. cp "${script:CUDA_LIB_DIR}\cudart64_*.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\"
  278. cp "${script:CUDA_LIB_DIR}\cublas64_*.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\"
  279. cp "${script:CUDA_LIB_DIR}\cublasLt64_*.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\"
  280. } else {
  281. write-host "Skipping CUDA generation step"
  282. }
  283. }
  284. function build_oneapi() {
  285. if ((-not "${env:OLLAMA_SKIP_ONEAPI_GENERATE}") -and ("${env:ONEAPI_ROOT}")) {
  286. # Get oneAPI version
  287. $script:ONEAPI_VERSION = icpx --version
  288. $script:ONEAPI_VERSION = [regex]::Match($script:ONEAPI_VERSION, '(?<=oneAPI DPC\+\+/C\+\+ Compiler )(?<version>\d+\.\d+\.\d+)').Value
  289. if ($null -ne $script:ONEAPI_VERSION) {
  290. $script:ONEAPI_VARIANT = "_v" + $script:ONEAPI_VERSION
  291. }
  292. init_vars
  293. $script:buildDir = "../build/windows/${script:ARCH}/oneapi$script:ONEAPI_VARIANT"
  294. $script:distDir ="$script:DIST_BASE\oneapi$script:ONEAPI_VARIANT"
  295. $script:cmakeDefs += @(
  296. "-G", "MinGW Makefiles",
  297. "-DLLAMA_SYCL=ON",
  298. "-DCMAKE_C_COMPILER=icx",
  299. "-DCMAKE_CXX_COMPILER=icx",
  300. "-DCMAKE_BUILD_TYPE=Release"
  301. )
  302. Write-Host "Building oneAPI"
  303. build
  304. # Ninja doesn't prefix with config name
  305. if ($null -ne $script:DUMPBIN) {
  306. & "$script:DUMPBIN" /dependents "${script:buildDir}/bin/ollama_llama_server.exe" | Select-String ".dll"
  307. }
  308. sign
  309. install
  310. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\libirngmd.dll" "${script:distDir}"
  311. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\libmmd.dll" "${script:distDir}"
  312. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\pi_level_zero.dll" "${script:distDir}"
  313. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\pi_unified_runtime.dll" "${script:distDir}"
  314. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\pi_win_proxy_loader.dll" "${script:distDir}"
  315. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\svml_dispmd.dll" "${script:distDir}"
  316. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\sycl7.dll" "${script:distDir}"
  317. cp "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_core.2.dll" "${script:distDir}"
  318. cp "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_sycl_blas.4.dll" "${script:distDir}"
  319. cp "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_tbb_thread.2.dll" "${script:distDir}"
  320. } else {
  321. Write-Host "Skipping oneAPI generation step"
  322. }
  323. }
  324. function build_rocm() {
  325. if ((-not "${env:OLLAMA_SKIP_ROCM_GENERATE}") -and ("${env:HIP_PATH}")) {
  326. $script:ROCM_VERSION=(get-item $env:HIP_PATH).Basename
  327. if ($null -ne $script:ROCM_VERSION) {
  328. $script:ROCM_VARIANT="_v"+$script:ROCM_VERSION
  329. }
  330. init_vars
  331. $script:buildDir="../build/windows/${script:ARCH}/rocm$script:ROCM_VARIANT"
  332. $script:distDir="$script:DIST_BASE\rocm$script:ROCM_VARIANT"
  333. $script:cmakeDefs += @(
  334. "-G", "Ninja",
  335. "-DCMAKE_C_COMPILER=clang.exe",
  336. "-DCMAKE_CXX_COMPILER=clang++.exe",
  337. "-DLLAMA_HIPBLAS=on",
  338. "-DHIP_PLATFORM=amd",
  339. "-DLLAMA_AVX=on",
  340. "-DLLAMA_AVX2=off",
  341. "-DCMAKE_POSITION_INDEPENDENT_CODE=on",
  342. "-DAMDGPU_TARGETS=$(amdGPUs)",
  343. "-DGPU_TARGETS=$(amdGPUs)"
  344. )
  345. # Make sure the ROCm binary dir is first in the path
  346. $env:PATH="$env:HIP_PATH\bin;$env:PATH"
  347. # We have to clobber the LIB var from the developer shell for clang to work properly
  348. $env:LIB=""
  349. if ($null -ne $env:OLLAMA_CUSTOM_ROCM_DEFS) {
  350. write-host "OLLAMA_CUSTOM_ROCM_DEFS=`"${env:OLLAMA_CUSTOM_ROCM_DEFS}`""
  351. $script:cmakeDefs += @("${env:OLLAMA_CUSTOM_ROCM_DEFS}")
  352. write-host "building custom ROCM GPU"
  353. }
  354. write-host "Building ROCm"
  355. build
  356. # Ninja doesn't prefix with config name
  357. ${script:config}=""
  358. if ($null -ne $script:DUMPBIN) {
  359. & "$script:DUMPBIN" /dependents "${script:buildDir}/bin/ollama_llama_server.exe" | select-string ".dll"
  360. }
  361. sign
  362. install
  363. # Assumes v5.7, may need adjustments for v6
  364. rm -ea 0 -recurse -force -path "${script:SRC_DIR}\dist\windows-${script:ARCH}\rocm\"
  365. md "${script:SRC_DIR}\dist\windows-${script:ARCH}\rocm\rocblas\library\" -ea 0 > $null
  366. cp "${env:HIP_PATH}\bin\hipblas.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\rocm\"
  367. cp "${env:HIP_PATH}\bin\rocblas.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\rocm\"
  368. # amdhip64.dll dependency comes from the driver and must be installed on the host to use AMD GPUs
  369. cp "${env:HIP_PATH}\bin\rocblas\library\*" "${script:SRC_DIR}\dist\windows-${script:ARCH}\rocm\rocblas\library\"
  370. } else {
  371. write-host "Skipping ROCm generation step"
  372. }
  373. }
  374. init_vars
  375. if ($($args.count) -eq 0) {
  376. git_module_setup
  377. apply_patches
  378. $tasks = @("build_static", "build_cpu")
  379. $jobs = @()
  380. if ($script:ARCH -ne "arm64") {
  381. $tasks += $("build_cpu_avx", "build_cpu_avx2", "build_cuda", "build_oneapi", "build_rocm")
  382. }
  383. foreach ($t in $tasks) {
  384. $jobs += @(Start-ThreadJob -ThrottleLimit 12 -FilePath .\gen_windows.ps1 -ArgumentList $t -Name $t)
  385. }
  386. get-job
  387. foreach ($job in $jobs) {
  388. write-host "----" $job.Name output follows
  389. receive-job -wait -job $job
  390. write-host "----" $job.Name $job.State
  391. write-host ""
  392. if ($job.State -contains 'Failed') {
  393. cleanup
  394. write-host "Terminating remaining jobs (this takes a while, you can ^C)"
  395. # TODO find some way to kill the spawned cmake processes faster
  396. remove-job -force -job $jobs
  397. exit(-1)
  398. }
  399. get-job
  400. }
  401. cleanup
  402. write-host "`ngo generate completed. LLM runners: $(get-childitem -path $script:DIST_BASE)"
  403. } else {
  404. for ( $i = 0; $i -lt $args.count; $i++ ) {
  405. write-host "performing $($args[$i])"
  406. & $($args[$i])
  407. }
  408. }