VGG16 in keystone

172 views
Skip to first unread message

Ramya Boggaram

unread,
Jan 22, 2024, 1:17:42 PM1/22/24
to Keystone Enclave Forum

Hello,

I am curious to research about how deep learning implementations are done on keystone? I am working on VGG16 now, but I am facing an issue related page fault. It would be great if you provide me on how you tried to implement VGG16 into keystone.

This is the error message I am trying to debug "[runtime] page fault at 0xa87e2 on 0x207102fd38 (scause: 0xf)" I am using vector.resize() in my implementation is this causing the malloc to fail? And my implementation is using https://github.com/tigercosmos/simple-vgg16 repository. Even when I am trying to add the 3rd layer also I am getting the same page fault.

How can I modify my implementation from preventing page fault in keystone and how does keystone handle the page faults?

fault.png

Request you to help me out in handling the issue. Thanks in advance!!!

Ramya Boggaram

unread,
Jan 25, 2024, 10:42:01 AM1/25/24
to Keystone Enclave Forum
Hello! 

I am using the docker version of keystone! 

As part of my previous work https://groups.google.com/g/keystone-enclave-forum/c/mS86rpjgrxA, I tried malloc implementation with different sizes in keystone and found that for 1MB and 2MB I could see the memory getting allocated but when I assign 3MB I am facing page fault and this whole case is inside the enclave. So what is the real reason behind it and how to solve it.

for 2MB it is:
image.png

image-2.png

For 3MB it is:
image-4.png

image-3.png

Thanks in advance!!

Paul Heath

unread,
Jan 25, 2024, 4:08:11 PM1/25/24
to Keystone Enclave Forum
when you set up the enclave, do you call params.setFreeMemSize() prior to enclave.init() ? 

Paul 

Message has been deleted

Ramya Boggaram

unread,
Jan 27, 2024, 11:36:16 AM1/27/24
to Keystone Enclave Forum
Hello,

Thanks for your reply!! I have tried to set the params.setFreeMemsize() with respect to my malloc() size that is 32MB and it worked but when I try to set 64MB it is failing again. Does keystone have any limitations within it related to memory allocations? If no how can we allocate arbitrary size of memory for enclave?

For 32MB  and 64MB I have provided the screenshots please have a look
image-8.png
image-7.png
image-6.png
image-10.png

Ramya Boggaram

unread,
Jan 27, 2024, 11:51:37 AM1/27/24
to Keystone Enclave Forum
For 32MB:
image-10.png

The host logic:
image-6.png

output:
image-7.png


For 64MB :
image-8.png

Alejandro Cabrera Aldaya

unread,
Jan 27, 2024, 4:33:10 PM1/27/24
to Ramya Boggaram, Keystone Enclave Forum
Hi

How much CMA did you reserve?
If it is 64MB it is expected to be failing with that freememsize.

BRs
Alejandro


--
You received this message because you are subscribed to the Google Groups "Keystone Enclave Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keystone-enclave-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keystone-enclave-forum/3162a829-8ad8-4ce8-98c8-e0215076c106n%40googlegroups.com.

Ramya Boggaram

unread,
Jan 29, 2024, 10:42:17 AM1/29/24
to Keystone Enclave Forum
Hey thanks for your reply May I know where I could find the CMA to check the value of it?

Thanks,
Ramya.

Yongzhi Wang

unread,
Feb 9, 2024, 7:23:12 AM2/9/24
to Keystone Enclave Forum
Hi,

We were able to run a VGG16 with much smaller parameters, using the keystoneenclaveorg/keystone:master docker image. We found the execution is very slow. I suspect it is because the memory we set is too small that caused it. We have used the params.setFreeMemsize() to set the memory to 1GB, but my observation is that the whole docker consumes around 3 GB of memory. I cannot set higher free memory. If I do so, running the .ke file will give us segmentation fault error, stating fail to allocate xxxx pages. I observed that the default CMA when starting the keystone QEMU is set to 1GB. I am wondering how can we change the CMA value for keystone. Can we do it with your provided docker container? If not, how can we set it in our built version?

Thanks!
Yongzhi

Ramya Boggaram

unread,
Feb 22, 2024, 12:19:40 PM2/22/24
to Keystone Enclave Forum
Hello!

As directed I tried to allocate the CMA with 2048M and It is failing to get reserved may I know the reason behind it?
image-11.png

Thanks,
Ramya.
Reply all
Reply to author
Forward
0 new messages