99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

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

代做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設計程序
  • 下一篇:哪些人可以辦理菲律賓團簽呢(跟團簽的材料)
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 trae 豆包網頁版入口 目錄網 排行網

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

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

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                成人免费三级在线| 美女爽到高潮91| 久久精品av麻豆的观看方式| 色狠狠综合天天综合综合| 中文字幕日韩一区| 国产精品亚洲第一| 国产欧美日韩在线| 99久久综合狠狠综合久久| 国产精品国产精品国产专区不片| www.欧美.com| 亚洲少妇30p| 欧美日韩一级二级| 青娱乐精品视频| 日韩区在线观看| 99久久久精品| 日韩高清在线电影| 精品日本一线二线三线不卡| 精久久久久久久久久久| 亚洲人成影院在线观看| 精品少妇一区二区三区视频免付费| 成人精品gif动图一区| 一区二区理论电影在线观看| 日韩欧美亚洲国产精品字幕久久久| 国产做a爰片久久毛片| 久久日一线二线三线suv| 99r精品视频| 久热成人在线视频| 亚洲美女屁股眼交| 久久蜜臀精品av| 91精品国产高清一区二区三区| 粉嫩aⅴ一区二区三区四区五区| 亚洲无线码一区二区三区| 亚洲国产高清不卡| 日韩限制级电影在线观看| 在线观看91精品国产入口| 国产成人免费网站| 黑人巨大精品欧美一区| 丝袜美腿亚洲综合| 亚洲va韩国va欧美va| 亚洲男同性视频| 中文字幕国产一区| 国产色婷婷亚洲99精品小说| 精品少妇一区二区三区在线视频| 在线成人免费观看| 欧美伊人久久久久久久久影院| 成人av网址在线观看| 岛国一区二区三区| 丁香六月综合激情| av电影在线不卡| 91麻豆免费观看| 色综合视频在线观看| 色噜噜狠狠成人网p站| 成人精品一区二区三区中文字幕| 国产呦精品一区二区三区网站| 另类欧美日韩国产在线| 久久91精品久久久久久秒播| 美日韩一区二区三区| 亚洲国产精华液网站w| 亚洲精品一区二区三区香蕉| 欧美电影免费观看高清完整版在线| 综合久久一区二区三区| 99久久久国产精品| 成人av网站大全| 波多野结衣精品在线| 成人av片在线观看| av在线不卡网| 色悠悠亚洲一区二区| 欧美午夜一区二区| 日韩一区二区电影网| 久久综合色天天久久综合图片| 精品国产伦一区二区三区免费| 欧美一区二区三区免费| 久久久国产精品不卡| 国产精品色在线观看| 亚洲在线观看免费视频| 偷拍亚洲欧洲综合| 激情综合亚洲精品| av在线播放一区二区三区| 在线播放中文一区| 国产精品视频一区二区三区不卡| 亚洲精品国产精华液| 美女尤物国产一区| av动漫一区二区| 日韩午夜激情电影| 最新不卡av在线| 久久精品久久久精品美女| 成人丝袜18视频在线观看| 91国产免费看| 久久久九九九九| 亚洲精品自拍动漫在线| 欧美a级理论片| 韩国成人福利片在线播放| 日本高清不卡aⅴ免费网站| 在线亚洲精品福利网址导航| 欧美一激情一区二区三区| 中文字幕字幕中文在线中不卡视频| 亚洲视频网在线直播| 亚洲国产婷婷综合在线精品| 国产一区二区三区四区在线观看| 国产成人综合在线观看| 91久久国产最好的精华液| 中文字幕国产精品一区二区| 五月综合激情日本mⅴ| 成人午夜碰碰视频| 欧美精品一区二区三区蜜臀| 亚洲美女电影在线| 久久99精品视频| 欧美性大战久久久久久久蜜臀 | 久久亚洲二区三区| 亚洲韩国精品一区| 国产成人精品亚洲午夜麻豆| 91超碰这里只有精品国产| 久久香蕉国产线看观看99| 老司机精品视频在线| 欧美一区二区三区在线观看| 1024成人网| 菠萝蜜视频在线观看一区| 久久婷婷国产综合精品青草| 久久精品国产亚洲高清剧情介绍 | 久久精品国产一区二区| 在线亚洲+欧美+日本专区| 久久久久高清精品| 久久精品国产免费看久久精品| 在线免费不卡视频| 国产精品盗摄一区二区三区| 国产河南妇女毛片精品久久久| 欧美三级中文字| 伊人性伊人情综合网| av网站免费线看精品| 制服丝袜亚洲网站| 美女网站视频久久| 欧美岛国在线观看| 精品影视av免费| 久久欧美一区二区| 国产成人精品亚洲777人妖| 欧美日韩色综合| 首页国产欧美日韩丝袜| 欧美不卡一区二区| 国产精品自在在线| 亚洲人成精品久久久久| 97se狠狠狠综合亚洲狠狠| 亚洲精品视频免费看| 色婷婷av一区| 日韩高清在线电影| 26uuu色噜噜精品一区二区| 日本麻豆一区二区三区视频| 日韩精品一区二区三区视频播放| 日本不卡一二三| 日韩视频一区二区| 福利视频网站一区二区三区| 久久先锋影音av鲁色资源| 蜜桃在线一区二区三区| 国产欧美日韩综合| 日本乱人伦aⅴ精品| 视频一区二区欧美| 中文字幕高清一区| 欧美日韩视频在线第一区| 激情综合色综合久久| 中文字幕一区三区| 欧美日韩一区小说| 国产成人av电影在线| 亚洲精品视频在线观看免费| 日韩精品中文字幕一区二区三区| 国产黄人亚洲片| 午夜影视日本亚洲欧洲精品| 久久一日本道色综合| 豆国产96在线|亚洲| 五月婷婷久久综合| 国产精品毛片久久久久久| 欧美日韩高清一区二区| 精品一区二区三区欧美| 亚洲夂夂婷婷色拍ww47| 91激情五月电影| 国产成人在线观看| 日韩精品每日更新| 136国产福利精品导航| 久久综合给合久久狠狠狠97色69| 欧美在线你懂得| 99免费精品在线| 国产精品18久久久久| 欧美a一区二区| 亚洲一区二区免费视频| 久久综合资源网| 欧美一卡二卡在线| 色综合咪咪久久| 99久久精品国产精品久久| 久久av资源网| 亚洲6080在线| 亚洲成人动漫在线免费观看| 中文一区二区在线观看| 欧美电影免费观看高清完整版在| 在线日韩av片| 91精品91久久久中77777| 高清国产一区二区| 国产资源在线一区| 亚洲福中文字幕伊人影院| 日本一区二区三区dvd视频在线| 欧美一二三四在线| 成人在线视频一区二区| 国产九色精品成人porny|