中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

php 開源企業(yè)網(wǎng)站百度網(wǎng)盤網(wǎng)頁版入口

php 開源企業(yè)網(wǎng)站,百度網(wǎng)盤網(wǎng)頁版入口,麗水微信網(wǎng)站建設(shè)公司,怎么把網(wǎng)站做的好看目錄 背景解決方法方法一:(治標(biāo)不治本)方法二:(triton-windows)- 安裝 MSVC 和 Windows SDK- vcredist 安裝- whl 安裝- 驗(yàn)證 背景 triton 目前官方只有Linux 版本,若未安裝,則會(huì)出…

目錄

  • 背景
  • 解決方法
    • 方法一:(治標(biāo)不治本)
    • 方法二:(triton-windows)
      • - 安裝 MSVC 和 Windows SDK
      • - vcredist 安裝
      • - whl 安裝
      • - 驗(yàn)證

背景

triton 目前官方只有Linux 版本,若未安裝,則會(huì)出現(xiàn)報(bào)錯(cuò):

ModuleNotFoundError: No module named 'triton'

在 Windows 系統(tǒng)中,如果直接用 pip install triton 來安裝,則會(huì)報(bào)錯(cuò):

ERROR: Could not find a version that satisfies the requirement triton (from versions: none)
ERROR: No matching distribution found for triton

解決方法

方法一:(治標(biāo)不治本)

有大神強(qiáng)行在Windows平臺上編譯了 triton 的whl,參考博客【window平臺安裝 triton】【Python|Windows 系統(tǒng)安裝 triton 的方法】,在下載路徑下 pip install 安裝 whl 文件即可。

即直接去 HuggingFace 上下載 triton 的 Windows 包:https://hf-mirror.com/madbuda/triton-windows-builds。

在此給出各個(gè)版本的下載鏈接:

  • 【triton 2.0.0 (Python 3.10)】
  • 【triton 2.1.0 (Python 3.10)】【triton 2.1.0 (Python 3.11)】
  • 【triton 3.0.0(Python 3.10)】【triton 3.0.0(Python 3.11)】【triton 3.0.0(Python 3.12)】

但是,實(shí)測上述安裝包里面 triton 核心的 triton.jittorch.compile 等功能均無法像Linux下正常運(yùn)行,上述安裝包只是從形式上完成編譯。

方法二:(triton-windows)

主要參考大佬的工作:triton-windows。

環(huán)境要求:

  1. torch >= 2.4.0
  2. CUDA >=12
  3. 安裝 MSVCWindows SDK
  4. 環(huán)境需要有 msvcp140.dllvcruntime140.dll。如果
  5. 然后就可以安裝他編譯的 whl,實(shí)現(xiàn)真正的功能。

- 安裝 MSVC 和 Windows SDK

參考博客:【W(wǎng)indows 如何僅安裝 MSVC 而不安裝 Visual Studio】

  1. 下載 Visual Studio Installer,下載地址為:https://aka.ms/vs/17/release/vs_BuildTools.exe。

  2. 運(yùn)行下載的exe,然后安裝單個(gè)組件:
    請?zhí)砑訄D片描述
    注意只需要下載單個(gè)組件,無需安裝Visual Studio。

  3. 修改環(huán)境變量,請參考博客:【W(wǎng)indows 如何僅安裝 MSVC 而不安裝 Visual Studio】
    位置為:系統(tǒng)高級設(shè)置-環(huán)境變量-系統(tǒng)變量。注意修改版本號為你自己的版本

    • 選擇 Path ,添加:
      C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64
      C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x64
    • 添加 LIB,添加3條:
      C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\lib\x64; C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\ucrt\x64; C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\um\x64
    • 添加 INCLUDE,添加6條:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include; C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\ucrt; C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um; C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\winrt; C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\cppwinrt; C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\shared
  4. 驗(yàn)證 MSVC 和 Windows SDK 安裝成功
    命令行里輸入 cl ,輸出 Microsoft (R) C/C++ Optimizing Compiler ... 即可。

- vcredist 安裝

vcredist 是必需的(也稱為“Visual C++ Redistributable for Visual Studio 2015-2022”,msvcp140.dllvcruntime140.dll)。如果沒有,可以從 https://aka.ms/vs/17/release/vc_redist.x64.exe 中安裝。

- whl 安裝

前期環(huán)境都配置無誤后,直接下載 whl 安裝:

pip install https://github.com/woct0rdho/triton-windows/releases/download/v3.1.0-windows.post5/triton-3.1.0-cp310-cp310-win_amd64.whl

也可手動(dòng)下載下來然后在下載路徑下安裝:

pip install triton-3.1.0-cp310-cp310-win_amd64.whl

- 驗(yàn)證

驗(yàn)證腳本為:

import torch
import triton
import triton.language as tl@triton.jit
def add_kernel(x_ptr, y_ptr, output_ptr, n_elements, BLOCK_SIZE: tl.constexpr):pid = tl.program_id(axis=0)block_start = pid * BLOCK_SIZEoffsets = block_start + tl.arange(0, BLOCK_SIZE)mask = offsets < n_elementsx = tl.load(x_ptr + offsets, mask=mask)y = tl.load(y_ptr + offsets, mask=mask)output = x + ytl.store(output_ptr + offsets, output, mask=mask)def add(x: torch.Tensor, y: torch.Tensor):output = torch.empty_like(x)assert x.is_cuda and y.is_cuda and output.is_cudan_elements = output.numel()grid = lambda meta: (triton.cdiv(n_elements, meta["BLOCK_SIZE"]),)add_kernel[grid](x, y, output, n_elements, BLOCK_SIZE=1024)return outputa = torch.rand(3, device="cuda")
b = a + a
b_compiled = add(a, a)
print(b_compiled - b)
print("If you see tensor([0., 0., 0.], device='cuda:0'), then it works")

不報(bào)錯(cuò)即說明配置成功。

http://www.risenshineclean.com/news/9570.html

相關(guān)文章:

  • 懷化 網(wǎng)站建設(shè)2345網(wǎng)址導(dǎo)航設(shè)為主頁
  • 合肥萬戶網(wǎng)絡(luò)科技有限公司搜索引擎優(yōu)化的主要工作
  • 上虞網(wǎng)站設(shè)計(jì)城關(guān)網(wǎng)站seo
  • 沈陽做網(wǎng)站公司重慶seo排名
  • 國內(nèi)課程網(wǎng)站建設(shè)現(xiàn)狀永久免費(fèi)低代碼開發(fā)平臺
  • 新華社兩學(xué)一做網(wǎng)站seo整合營銷
  • 編輯網(wǎng)站內(nèi)容有沒有批量辦法什么是seo關(guān)鍵詞
  • 網(wǎng)站程序和空間區(qū)別網(wǎng)絡(luò)推廣優(yōu)化網(wǎng)站
  • 寧波網(wǎng)站建設(shè)推廣公司青島百度快速排名優(yōu)化
  • 零食網(wǎng)站頁面模板湖南專業(yè)seo公司
  • 房產(chǎn)信息網(wǎng)站模板電商平臺怎么加入
  • 音樂網(wǎng)站開發(fā)參考文獻(xiàn)百度指數(shù)代表什么意思
  • 雞西公司做網(wǎng)站關(guān)鍵詞分為哪幾類
  • 哪有專做注冊小網(wǎng)站的客戶資源買賣平臺
  • wordpress懸浮bar深圳seo網(wǎng)站優(yōu)化公司
  • 企業(yè)網(wǎng)站怎么做推廣比較好網(wǎng)站模板建站公司
  • 二手車網(wǎng)站建站海豹直播nba
  • 做蛋糕有哪些網(wǎng)站域名查詢網(wǎng)
  • 網(wǎng)站360做的標(biāo)記如何取消市場營銷策劃方案3000字
  • wordpress定時(shí)插件seo是什么意思seo是什么職位
  • 濰坊哪家網(wǎng)站制作公司好關(guān)鍵詞歌詞任然
  • 網(wǎng)站開發(fā)工程師自學(xué)個(gè)人開發(fā)app可以上架嗎
  • 營口市代做網(wǎng)站三只松鼠口碑營銷案例
  • 網(wǎng)站的標(biāo)簽怎么修改做國外網(wǎng)站
  • 射陽網(wǎng)站設(shè)計(jì)b站大全永不收費(fèi)2023入口在哪
  • 區(qū)塊鏈開發(fā)是什么意思常德網(wǎng)站優(yōu)化公司
  • 江西省城鄉(xiāng)建設(shè)培訓(xùn)網(wǎng)-官方網(wǎng)站關(guān)鍵詞優(yōu)化簡易
  • 網(wǎng)站建設(shè)價(jià)格標(biāo)準(zhǔn)報(bào)價(jià)軟件開發(fā)交易平臺
  • 黃江做網(wǎng)站免費(fèi)男女打撲克的軟件
  • 手機(jī)wap網(wǎng)站的分析網(wǎng)絡(luò)營銷官網(wǎng)