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;">

                欧美成人a∨高清免费观看| 欧美韩国日本综合| 亚洲乱码国产乱码精品精小说 | 久久精品免费看| 欧美不卡一区二区| 亚洲自拍都市欧美小说| 日韩一级二级三级精品视频| 国产成人综合视频| 亚洲国产精品天堂| 久久精品一区蜜桃臀影院| 北岛玲一区二区三区四区| 亚洲成人自拍网| 国产亚洲欧美日韩日本| 欧美怡红院视频| 国产美女娇喘av呻吟久久| 一区二区三区在线视频播放| 2020国产精品| 777亚洲妇女| 色狠狠色噜噜噜综合网| 精品一区二区影视| 天天色天天操综合| 亚洲一区二区三区精品在线| 日本一区二区免费在线| 欧美成人午夜电影| 91精品国产综合久久久蜜臀粉嫩| fc2成人免费人成在线观看播放| 日韩高清不卡在线| 一区二区三区色| 国产精品卡一卡二卡三| 精品国产乱码久久久久久老虎| 欧美日韩一区二区欧美激情| 色诱视频网站一区| 成人性生交大片免费看中文网站| 老色鬼精品视频在线观看播放| 亚洲一区二区三区免费视频| 一区二区三区四区乱视频| 国产欧美一区视频| 精品成人私密视频| 日韩精品影音先锋| 欧美一区二区三区四区在线观看 | 蜜臀av一区二区三区| 一区二区在线电影| 中文字幕一区不卡| 亚洲国产精品成人综合 | 欧美国产欧美亚州国产日韩mv天天看完整 | 成人激情动漫在线观看| 国产一区二区三区香蕉| 免费在线观看成人| 麻豆一区二区三区| 久久激情五月婷婷| 国产一区二区三区免费在线观看| 久久超碰97中文字幕| 久久国产成人午夜av影院| 另类小说综合欧美亚洲| 精品一区二区三区影院在线午夜| 免费在线看成人av| 国产99一区视频免费| www.日韩大片| 91香蕉视频污| 欧美日韩性生活| 日韩一级二级三级精品视频| 久久久久久久久蜜桃| 国产精品久久久一本精品| 亚洲人妖av一区二区| 亚洲午夜激情av| 蜜桃视频在线观看一区二区| 国产在线国偷精品免费看| 高清av一区二区| 99re免费视频精品全部| 欧美日韩中文一区| 精品日韩一区二区| 1000部国产精品成人观看| 亚洲一区二区av在线| 久久99精品久久久久久| 成人免费看的视频| 欧美日韩久久久久久| 久久毛片高清国产| 亚洲自拍偷拍欧美| 国产美女娇喘av呻吟久久| 91麻豆6部合集magnet| 欧美一区二区不卡视频| 国产精品日韩成人| 午夜在线成人av| 成人国产在线观看| 91精品国产欧美一区二区成人| 欧美激情一区二区在线| 香蕉影视欧美成人| 91在线视频在线| 精品国产三级电影在线观看| 亚洲精品乱码久久久久久日本蜜臀| 免费成人美女在线观看.| 99久久免费国产| 精品蜜桃在线看| 日韩综合在线视频| 99久精品国产| 久久久精品2019中文字幕之3| 亚洲成人在线观看视频| 9l国产精品久久久久麻豆| 欧美电视剧免费观看| 亚洲福利视频一区二区| 91在线精品一区二区三区| 国产欧美日本一区视频| 蜜桃视频在线一区| 制服丝袜日韩国产| 亚洲高清视频在线| 欧美在线小视频| 亚洲日本在线看| 91在线看国产| 亚洲伦在线观看| 91亚洲国产成人精品一区二三| 欧美精品一区二| 美女脱光内衣内裤视频久久网站 | 紧缚捆绑精品一区二区| 666欧美在线视频| 亚洲一二三专区| 欧美亚洲高清一区二区三区不卡| 国产精品短视频| 99国产精品一区| 亚洲久草在线视频| 色屁屁一区二区| 亚洲v日本v欧美v久久精品| 在线亚洲免费视频| 亚洲成人综合在线| 欧美一级一级性生活免费录像| 日韩福利电影在线观看| 日韩一区二区三区视频| 精品一区二区免费视频| 精品国产不卡一区二区三区| 精品在线视频一区| 久久精品亚洲一区二区三区浴池| 国产一区激情在线| 国产精品久久夜| 在线精品视频一区二区三四| 亚洲制服丝袜av| 日韩一区二区精品葵司在线| 九九精品一区二区| 国产欧美精品国产国产专区| 99精品视频一区二区三区| 亚洲在线成人精品| 日韩一区二区免费电影| 福利电影一区二区| 亚洲精品伦理在线| 欧美一区二区三区在线| 国产高清在线精品| 亚洲精品欧美二区三区中文字幕| 欧美日本一道本| 成人激情开心网| 日韩高清欧美激情| 国产三级一区二区三区| 色天天综合色天天久久| 麻豆成人91精品二区三区| 国产精品免费人成网站| 欧美日韩国产大片| 国产一区二区中文字幕| 亚洲综合偷拍欧美一区色| 精品国产91洋老外米糕| 91黄色小视频| 国产成人三级在线观看| 亚洲成人免费看| 国产精品久久久久久久久久久免费看 | 久久精品一区二区三区四区| 欧美亚洲高清一区二区三区不卡| 老司机精品视频线观看86| 亚洲乱码中文字幕| 久久久一区二区三区捆绑**| 在线日韩av片| eeuss鲁一区二区三区| 久久精品99国产精品日本| 亚洲国产一区视频| 国产精品久久久久久亚洲伦| 日韩三级.com| 欧美日韩一卡二卡三卡| 成人久久久精品乱码一区二区三区 | 亚洲成av人片一区二区梦乃| 亚洲国产高清在线观看视频| 69久久99精品久久久久婷婷 | 亚洲成人av在线电影| 中文乱码免费一区二区| 欧美mv日韩mv亚洲| 91精品欧美综合在线观看最新| 色综合天天综合| a级高清视频欧美日韩| 国产精品一二二区| 久久精品国产一区二区三| 无吗不卡中文字幕| 亚洲图片自拍偷拍| 亚洲色图清纯唯美| 国产精品视频看| 国产日韩欧美精品在线| 久久综合色一综合色88| 精品久久久久香蕉网| 日韩一级片在线观看| 欧美一激情一区二区三区| 欧美精品777| 欧美一区日韩一区| 欧美电视剧免费观看| 欧美一区日本一区韩国一区| 91精品国产综合久久福利| 欧美一区二区三区的| 日韩免费一区二区|