Hi, all.
I'm evaluating pytorch on gem5 fs.
This is my configuration of the gem5 full system.
python version of disk image: Python 3.7.10
torch version 1.9.0+cpu
torchvision 0.10.0+cpu

and below is code what I use
=====================================================================
import torch
import torch.nn as nn
import torch.nn.functional as F

class CNN(nn.Module):
  def __init__(self):
    super(CNN, self).__init__()
    self.conv1 = nn.Conv2d(in_channels=1, out_channels=3, kernel_size=5,
stride=1)
    self.conv2 = nn.Conv2d(in_channels=3, out_channels=10, kernel_size=5,
stride=1)
    self.fc1 = nn.Linear(10 * 12 * 12, 50)
    self.fc2 = nn.Linear(50, 10)

  def forward(self, x):
    x = F.relu(self.conv1(x))
    x = F.relu(self.conv2(x))
    x = x.view(-1, 10 * 12 * 12)
    x = F.relu(self.fc1(x))
    x = self.fc2(x)
    return x

cnn = CNN()
output = cnn(torch.randn(10, 1, 20, 20))  # Input Size: (10, 1, 20, 20)
=====================================================================
and this is command for gem5 fs
build/X86/gem5.opt configs/example/fs.py \
        --kernel=$M5_PATH/binaries/vmlinux\
        --disk-image=$M5_PATH/disks/ubuntu-test.img\
        --cpu-type=X86KvmCPU --cpu-clock=2GHz\
        --num-cpu=1 --mem-size=8GB\
        --caches --l2cache --l1d_size=128B --l1i_size=128B --l1d_assoc=1
--l1i_assoc=1 --cacheline_size=64 --mem-type=DDR3_1600_8x8

vmlinux version : linux-4.14.234
ubuntu img created by ubuntu server 16.04.7.iso

If I run this source code in the host system or img through qemu, it runs
fine.
The source code will not be executed in the same img file booted via gem5
fs.

Debugging result shows that the program freezes when nn.conv2d is called.

Does anybody know how to solve this problem?

-- 

강주연, Juyeon Kang
Intelligent Data-centric Emerging Architecture Lab
College of Information & Communication Engineering
SungKyunKwan University, Suwon, South Korea
Office : 031-299-4659

[image: image.gif]
[image: Mailtrack]
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&;>
Sender
notified by
Mailtrack
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&;>
21.
08. 04. 오전 10:23:22
ᐧ
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to