国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代做Computer Architecture、代寫Gem5 編程

時(shí)間:2024-06-08  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



Computer Architecture
2024 Spring
Final Project Part 2Overview
Tutorial
● Gem5 Introduction
● Environment Setup
Projects
● Part 1 (5%)
○ Write C++ program to analyze the specification of L1 data cache.
● Part 2 (5%)
○ Given the hardware specifications, try to get the best performance for more 
complicated program.
2Project 2
3In this project, we will use a two-level cache 
computer system. Your task is to write a 
ViT(Vision Transformer) in C++ and optimize it. 
You can see more details of the system 
specification on the next page.
Description
4System Specifications
● ISA: X86
● CPU: TimingSimpleCPU (no pipeline, CPU stalls on every memory request)
● Caches
* L1 I cache and L1 D cache connect to the same L2 cache
● Memory size: 8192MB
5
I cache 
size
I cache 
associativity
 D cache 
size
D cache 
associativity
Policy Block size
L1 cache 16KB 8 16KB 4 LRU **B
L2 cache – – 1MB 16 LRU **BViT(Vision Transformer) – Transformer Overview
6
● A basic transformer block consists of 
○ Layer Normalization
○ MultiHead Self-Attention (MHSA) 
○ Feed Forward Network (FFN)
○ Residual connection (Add)
● You only need to focus on how to 
implement the function in the red box
● If you only want to complete the project 
instead of understanding the full 
algorithm about ViT, you can skip the 
section masked as redViT(Vision Transformer) – Image Pre-processing
7
● Normalize, resize to (300,300,3) and center crop to (224,224,3)ViT(Vision Transformer) – Patch Encoder
8
● In this project, we use Conv2D as Patch 
Encoder with kernel_size = (16,16), stride = 
(16,16) and output_channel = 768
● (224,224,3) -> (14,14, 16*16*3) -> (196, 768)ViT(Vision Transformer) – Class Token
9
● Now we have 196 tokens and each 
token has 768 features
● In order to record global information, we 
need concatenate one learnable class 
token with 196 tokens
● (196,768) -> (197,768)ViT(Vision Transformer) – Position Embedding
10
● Add the learnable position information 
on the patch embedding
● (197,768) + 
position_embedding(197,768) -> 
(197,768)ViT(Vision Transformer) – Layer Normalization
11
T
# of tokens
C
embedded dimension
● Normalize each token
● You need to normalize with the formulaAttention
ViT(Vision Transformer) – MultiHead Self Attention (1)
12
● Wk
, Wq
, Wv 
∈ RC✕C
● b
q
 , bk
, bv
∈ RC
● W

∈ RC✕C
 
● b
o
 ∈ RC
Input
Linear
Projection
X Attention
split 
into 
heads
merge 
heads
Output
Linear
Projection
Y
Wk
, Wq
, Wv W

b
q
 , bk
, bv b
o
 ViT(Vision Transformer) – MultiHead Self Attention (2)
13
T
# of tokens
C
embedded dimension
● Get Q, K, V ∈ RT✕(NH*H) after input linear projection
● Split Q, K, V into Q1
, Q2
, Q3
,..., QNH K1
, K2
, K3
,..., KNH V1
, V2
, V3
,..., VNH 
∈ RT✕H
H
hidden dimension
Linear Projection and split into heads
Linear Projection
Q = XWq
T
 + b
q
K = XWk
T
 + bk
V = XW
v
T
 + b
v
NH
# of head C = H * NHViT(Vision Transformer) – MultiHead Self Attention (2)
14
● For each head i, compute Si
 = QiKi
T
/square_root(H) ∈ RT✕T
● Pi = Softmax(Si
 ) ∈ RT✕T
, Softmax is a row-wise function
● Oi = Pi Vi ∈ RT✕H
Matrix
Multiplication
and scale
Qi
Ki
Softmax
Matrix
Multiplication Vi
Oi
SoftmaxViT(Vision Transformer) – MultiHead Self Attention (3)
15
T
# of tokens
C
embedded dimension
● Oi ∈ RT✕H
, O = [O1
, O2
,...,O2
 ]
H
hidden dimension
merge heads and Linear Projection
Linear Projection
output = OWo
T
 + b
o
NH
# of headViT(Vision Transformer) – Feed Forward Network
16
● Get Q, K, V ∈ RT✕(h*H) after input linear projection
● Split Q, K, V into Q1
, Q2
, Q3
,..., Qh
 K1
, K2
, K3
,..., Kh V1
, V2
, V3
,..., Vh ∈ RT✕H
T
# of tokens
C
embedded dimension
Input
Linear
Projection
T
# of tokens
OC
hidden dimension
GeLU
output
Linear
ProjectionViT(Vision Transformer) – GeLU
17ViT(Vision Transformer) – Classifier
18
● Contains a Linear layer to transform 768 features to 200 class
○ (197, 768) -> (197, 200)
● Only refer to the first token (class token)
○ (197, 200) -> (1, 200)ViT(Vision Transformer) – Work Flow
19
Pre-pocessing
Embedder
Transformer x12
Classifier
m5_dump_init
Load_weight
m5_dump_stat
Argmax
layernorm
MHSA
layernorm
FFN
matmul
attention
matmul
matmul
layernorm
matmul
Black footed Albatross
+
+
gelu
matmul
gelu
$ make gelu_tb
$ make matmul_tb
$ make layernorm_tb
$ make MHSA_tb
$ make feedforward_tb
 $ make transformer_tb
$ run_all.sh
layernorm
layernorm
MHSA
residualViT(Vision Transformer) – Shape of array
20
layernorm token 1 token 2 …… token T
C
input/output [T*C]
MHSA input/output/o [T*C]
MHSA qkv [T*3*C] q token 1
C
k token 1 v token 1 …… q token T k token T v token T
feedforward input/output [T*C]
feedforward gelu [T*OC] token 1
OC
token 2 …… token TCommon problem
21
● Segmentation fault
○ ensure that you are not accessing a nonexistent memory address
○ Enter the command $ulimit -s unlimited All you have to do is
22
● Download TA’s Gem5 image
○ docker pull yenzu/ca_final_part2:2024
● Write C++ with understanding the algorithm in ./layer folder
○ make clean
○ make <layer>_tb
○ ./<layer>_tbAll you have to do is
23
● Ensure the ViT will successfully classify the bird
○ python3 embedder.py --image_path images/Black_Footed_Albatross_0001_796111.jpg 
--embedder_path weights/embedder.pth --output_path embedded_image.bin
○ g++ -static main.cpp layer/*.cpp -o process
○ ./process
○ python3 run_model.py --input_path result.bin --output_path torch_pred.bin --model_path 
weights/model.pth
○ python3 classifier.py --prediction_path torch_pred.bin --classifier_path 
weights/classifier.pth
○ After running the above commands, you will get the following top5 prediction.
● Evaluate the performance of part of ViT, that is layernorm+MHSA+residual
○ Need about 3.5 hours to finish the simulation
○ Check stat.txtGrading Policy
24
● (50%) Verification
○ (10%) matmul_tb
○ (10%) layernorm_tb
○ (10%) gelu_tb
○ (10%) MHSA_tb
○ (10%) transformer_tb
● (50%) Performance
○ max(sigmoid((27.74 - student latency)/student latency))*70, 50)
● You will get 0 performance point if your design is not verified.Submission
● Please submit code on E3 before 23:59 on June 20, 2024.
● Late submission is not allowed.
● Plagiarism is forbidden, otherwise you will get 0 point!!!
25
● Format
○ Code: please put your code in a folder 
named FP2_team<ID>_code and compress 
it into a zip file.
2
2
2FP2_team<ID>_code folder 
26
● You should attach the following documents
○ matmul.cpp
○ layernorm.cpp
○ gelu.cpp
○ attention.cpp
○ residual.cpp

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp



















 

掃一掃在手機(jī)打開當(dāng)前頁
  • 上一篇:代做QBUS3600、代寫Python設(shè)計(jì)程序
  • 下一篇:哪些人可以辦理菲律賓團(tuán)簽?zāi)兀ǜ鷪F(tuán)簽的材料)
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營技巧,多多開團(tuán)助手,多多出評軟件徽y1698861
    超全面的拼多多電商運(yùn)營技巧,多多開團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 豆包網(wǎng)頁版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    久久免费一级片| 深夜福利91大全| 久激情内射婷内射蜜桃| 亚洲欧美久久久久一区二区三区| 黄色一级片黄色| 久久精品99久久久香蕉| 日本福利视频网站| 国产精品69精品一区二区三区| 欧美成人一二三| 国产在线播放不卡| 欧美xxxx做受欧美| 国产一区二区视频在线观看| 国产精品久久久久9999爆乳| 欧美福利一区二区三区| 深夜福利国产精品| 欧美综合在线观看| 久久视频中文字幕| 欧美在线日韩在线| 日日狠狠久久偷偷四色综合免费| 日本一本草久p| 久精品国产欧美| 欧美亚洲日本黄色| 久久手机精品视频| 国产日韩欧美一区二区| 欧美激情视频在线观看| 国产免费一区二区三区在线观看 | 久久99久久精品国产| 日本黄网免费一区二区精品| 丝袜亚洲欧美日韩综合| 日本公妇乱淫免费视频一区三区| 久久精品99久久| 日本91av在线播放| 国产成人无码av在线播放dvd | 国产精品 日韩| 日韩欧美国产免费| 久久精品亚洲94久久精品| 欧美一区三区二区在线观看| 国产精品乱子乱xxxx| 国产九区一区在线| 亚洲一区二区在线免费观看| 91精品久久久久久久久| 日韩激情久久| 久久亚洲电影天堂| av一区二区三区四区电影| 色播五月综合| 国产精品日韩欧美大师| 国产精品永久免费| 日本一区二区三区视频免费看| 久久久久在线观看| 国产中文字幕日韩| 一区二区欧美日韩| 久久久久久美女| 国产一区二区久久久| 亚洲mm色国产网站| 久久久久久久久久久99| 毛片一区二区三区四区| 亚洲午夜激情| 色噜噜亚洲精品中文字幕| 国产欧美日韩小视频| 性亚洲最疯狂xxxx高清| 久久精品人人爽| 成人免费淫片aa视频免费| 日本高清视频一区二区三区| 国产精品久久精品国产| 91精品美女在线| 蜜桃日韩视频| 婷婷五月色综合| 久久伊人免费视频| 国产成人精品免费视频| 精品一区二区三区日本| 亚洲精品欧美精品| 国产精品爽爽ⅴa在线观看| 97久久国产精品| 国产综合在线观看视频| 日本精品一区二区三区不卡无字幕 | 国产av熟女一区二区三区| 国产日产欧美精品| 日本91av在线播放| 色综合久久久久久中文网| 久久激情五月丁香伊人| 91精品国产99久久久久久| 欧美在线影院在线视频| 亚洲精品成人久久久998| 国产精品久久久久av免费| 国产成人在线视频| 97国产精品视频| 美女视频久久| 欧美日韩高清免费| 午夜精品久久久久久久99热 | 成人国内精品久久久久一区| 激情小说网站亚洲综合网| 日韩一区二区三区资源 | 精品国内亚洲在观看18黄| 69av在线播放| 国产精品一区二区三区免费观看 | 97人人香蕉| 国产日韩一区二区| 欧美日韩天天操| 色就是色欧美| 亚洲区一区二区三区| 欧美极品美女电影一区| 久久综合九色九九| 国产精品久久久影院| xxx一区二区| 久久久久欧美| 久久另类ts人妖一区二区 | 欧美中文在线视频| 日韩欧美国产综合在线| 日本一区精品| 丁香色欲久久久久久综合网| 综合一区中文字幕| 国产av国片精品| 欧美成人久久久| 欧美成人免费va影院高清| 国产精品视频久久| 国产精品视频免费在线| 久久天天躁狠狠躁老女人| 久久天天躁狠狠躁夜夜爽蜜月| 日韩有码在线观看| 色阁综合伊人av| 久久精品视频在线| 国产精品久久久久久五月尺| 国产精品久久久久久久久久东京| 国产精品美女久久久久av超清| www.精品av.com| 国产成人免费观看| 国产精品视频公开费视频| 国产精品伦子伦免费视频| 久久躁日日躁aaaaxxxx| 色综合久综合久久综合久鬼88| 久久99精品久久久久久青青91| 色综合导航网站| 综合一区中文字幕| 成人做爰www免费看视频网站| 日韩av电影在线观看| 日韩精品视频在线观看视频| 欧美日韩国产综合在线| 免费在线观看日韩视频| 国产呦系列欧美呦日韩呦| 国产一区二区网| 成人中文字幕在线观看| 久久亚洲午夜电影| 日韩视频在线免费观看| 国产精品久久久一区二区三区| 久久综合九色九九| 亚洲自拍av在线| 日本国产欧美一区二区三区| 欧美一区视频在线| 国产一区一区三区| 97免费视频在线播放| 国产成人精品免费视频大全最热| 国产成人涩涩涩视频在线观看| 久久亚洲私人国产精品va| 一区二区成人国产精品| 日日噜噜夜夜狠狠久久丁香五月| 日韩毛片在线免费看| 精品网站在线看| 97成人在线观看视频| 色偷偷av一区二区三区| 国产精品电影网| 亚洲高潮无码久久| 热re99久久精品国产66热| 国产一区精品在线| 久久亚洲免费| 久久中文久久字幕| 性色av香蕉一区二区| 黄色a级片免费看| 不卡影院一区二区| 日韩三级成人av网| 精品国产免费av| 日韩免费在线看| 国产精品亚洲一区| www.精品av.com| 亚洲一卡二卡三卡| 欧美日韩精品久久久免费观看| 99精彩视频| 国产精品久久7| 日韩在线第一区| 狠狠综合久久av| 久久久欧美精品| 欧美精品在线免费| 青青久久av北条麻妃黑人| 成人精品一区二区三区 | 亚洲a区在线视频| 精品视频在线观看| 久草综合在线观看| 亚洲综合欧美日韩| 国产最新免费视频| 久操手机在线视频| 亚洲区成人777777精品| 国内精品久久影院| 国产成人一区二区三区电影 | 国产精品入口夜色视频大尺度| 午夜精品在线观看| 国产欧美精品日韩精品| 国产精品爽爽爽爽爽爽在线观看| 亚洲高清不卡一区| 国产免费一区二区三区香蕉精| 精品国内产的精品视频在线观看| 五月天国产一区|