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

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代做Computer Architecture、代寫Gem5 編程

時間:2024-06-08  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



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



















 

掃一掃在手機打開當前頁
  • 上一篇:代做QBUS3600、代寫Python設計程序
  • 下一篇:哪些人可以辦理菲律賓團簽呢(跟團簽的材料)
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 寵物飼養 十大衛浴品牌排行 suno 豆包網頁版入口 wps 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    日韩在线www| 国产成人精品免费久久久久| 亚洲成人网上| 中文字幕久久一区| 一区二区三区四区免费观看| 欧美激情精品久久久久| 一区二区三区四区五区视频| 一区精品视频| 亚洲熟妇av一区二区三区| 欧美精品在线播放| 久久99久久久久久久噜噜| 国产成人免费91av在线| 国产成人精品一区| 国产精品高精视频免费| 精品国产区在线| 欧美精品久久久久久久久 | 国产成人精品日本亚洲11| 久久免费国产视频| 国产成人无码av在线播放dvd | 欧美一区二区.| 欧洲亚洲一区二区三区四区五区| 欧美亚洲另类制服自拍| 欧美两根一起进3p做受视频| 国产视频一区二区三区在线播放| 成年丰满熟妇午夜免费视频| 久久亚裔精品欧美| 色偷偷88888欧美精品久久久| 久久精品人人做人人爽| 久久精品中文字幕| 欧美日本中文字幕| 亚洲欧美日韩另类精品一区二区三区| 日日碰狠狠丁香久燥| 欧美精品123| 成人久久久久久| 日韩在线中文视频| 欧美激情综合亚洲一二区| 色综合av综合无码综合网站| 欧美激情一区二区三区在线视频| 国产伦理久久久| 久久久久中文字幕2018| 九色精品免费永久在线| 日本免费在线精品| 国产日韩欧美一区二区| 久久av综合网| 久久久久久国产| 秋霞在线观看一区二区三区| 国产免费一区二区三区在线能观看| 91精品国产综合久久香蕉922| 国产成人免费av| 亚洲淫片在线视频| 狠狠色伊人亚洲综合网站色| 久久免费国产视频| 国产精品精品软件视频| 亚洲高清精品中出| 国产日韩综合一区二区性色av| 国产福利一区视频| 久久久久成人网| 欧美日韩在线观看一区| 国产精品69页| 中文字幕av日韩精品| 免费在线a视频| 国产二区视频在线播放| 欧美激情伊人电影| 欧美日韩高清在线一区| 国产国语刺激对白av不卡| 一区二区免费在线观看| 蜜桃视频一区二区在线观看| 日韩在线中文视频| 日韩中文字幕av在线| 成人做爽爽免费视频| 国产精品成人观看视频国产奇米| 91精品一区二区三区四区| 色综合天天综合网国产成人网| 黄色影院一级片| 久久久久久久国产| 亚洲AV无码成人精品一区| 成人免费福利视频| 一区二区三区三区在线| 精品一区国产| 国产精品高潮呻吟久久av黑人| 日韩欧美手机在线| 久久久久福利视频| 亚洲精蜜桃久在线| 操人视频欧美| 伊人久久大香线蕉成人综合网| 国产伦精品一区二区三区视频黑人| 国产精品福利网| 免费国产a级片| 精品久久久久久一区二区里番| 麻豆精品传媒视频| 欧美精品免费在线| 国产奶头好大揉着好爽视频| 国产aⅴ夜夜欢一区二区三区| 国产熟人av一二三区| 精品国产一区二区三区在线| 国产欧美日本在线| 欧美激情第1页| 国产伦精品一区二区三区视频孕妇 | 国产激情片在线观看| 性亚洲最疯狂xxxx高清| 久久综合一区二区三区| 污污污污污污www网站免费| 91精品91久久久中77777老牛| 91精品久久久久久久久久久 | 日韩在线观看a| 久久久国内精品| 日韩欧美视频一区二区三区四区| 丝袜美腿亚洲一区二区| 欧美福利一区二区三区| 久久成人亚洲精品| www日韩在线观看| 日韩一区二区高清视频| 久久久久久久香蕉| 激情五月综合色婷婷一区二区| 国产精品成av人在线视午夜片| 国产女大学生av| 亚洲国产一区二区在线| 久久久久久久一| 国产中文字幕91| 久久久久久18| 国产l精品国产亚洲区久久| 欧美日韩亚洲免费| 欧美成人免费va影院高清| 成人国内精品久久久久一区| 天堂va久久久噜噜噜久久va| 色噜噜国产精品视频一区二区| 国产亚洲精品美女久久久m| 亚洲一区二区三区精品视频| 久久久久久久久久伊人| 麻豆成人小视频| 欧美一区二区三区在线免费观看| 久久精品国产亚洲7777| 国产美女主播在线| 日韩av电影在线观看| 国产成人无码av在线播放dvd| 国产美女三级视频| 日韩免费不卡av| 欧美人与性动交| 国产成人无码精品久久久性色| 国产精品自拍偷拍视频| 日本a在线天堂| 欧美激情精品久久久久久久变态 | www久久99| 欧美精品一区二区三区三州| 亚洲色成人www永久在线观看| 久久久久久久9| 福利在线一区二区| 国内精品久久久久伊人av| 午夜精品区一区二区三| 国产精品第一页在线| 久久99久久精品国产| 成人一级生活片| 国模杨依粉嫩蝴蝶150p| 欧美一级视频一区二区| 精品国产三级a∨在线| 久久久久久久999精品视频| 超碰成人在线免费观看| 国内精品久久国产| 日韩国产欧美亚洲| 在线观看成人一级片| 久久久精品美女| 久久久一二三四| 高清欧美性猛交xxxx| 美女黄毛**国产精品啪啪| 日本a级片电影一区二区| 亚洲综合av一区| 国产aaa免费视频| 久久亚洲电影天堂| 久久天堂电影网| 久久久久久久香蕉| 国产成人av网址| 国产精品99一区| 国产精品亚洲一区二区三区| 精品少妇在线视频| 激情视频在线观看一区二区三区| 日韩av在线一区二区三区| 亚洲欧美国产不卡| 在线精品日韩| 久久99视频免费| 精品国产一区二区三区麻豆小说| 国产精品久久在线观看| 久热99视频在线观看| 久久精品国产亚洲精品| 日韩在线中文字幕| 日韩在线免费视频观看| 久久久久免费视频| 久久久久久久免费视频| 视频在线一区二区| 久久久国产视频| 国产精品久久久久7777婷婷| 久久黄色av网站| 精品国产区一区二区三区在线观看| 色婷婷综合久久久久中文字幕1| 日韩中文综合网| 国产精品视频一区二区三区四 | 久久久亚洲天堂| 国产精品av网站| 久久精品在线免费视频| 国产极品粉嫩福利姬萌白酱| 久久免费视频1|