[gem5-users] Re: How to run Python code with TensorFlow in Gem5 syscall emulation mode?

2020-10-24 Thread Dimitrios Chasapis via gem5-users

Hi,

I have been running keras (python interface for tensorflow)  in Gem5.  
If I understand correctly you want to run a python script in Gem5 from a 
C++ source file, correct?  Gem5 already uses pytbind11 (which is a 
header's only library simplifying embedding python code in C++ and vice 
versa).  Thus, I think you don't need to add any compilation flags etc.  
You can see the documentation here.



Note that you don't need to start or kill the interpreter, I think gem5 
already does that.  The only thing that may cause some issues is to take 
care that both Gem5 and your python libraries link to the same third 
party libraries.  For me these were h5 and protobuff.


For the systemcall I never had this problem, maybe it has to do with the 
specific code you are trying to run?


Hasan, for me it runs both for FS and SE, the code is the same for both 
versions, it shouldn't matter which one you use, but you are right that 
in FS you won't run into the systemcall problem.


Best,

Dimitrios


On 10/23/2020 10:54 PM, Abhishek Singh via gem5-users wrote:

Hi Hasan,
I have been trying to run tensorflow on gem5, have you tried full system?
I was able to run simple python code like hello on it.
Let me know if it works

On Fri, Oct 23, 2020 at 12:28 PM Hasan, S M Shamimul via gem5-users 
mailto:gem5-users@gem5.org>> wrote:


Hello,

* I want to run cosmoGAN code inside Gem5. The cosmoGAN code is
available here (https://github.com/MustafaMustafa/cosmoGAN). The
cosmoGAN code is in Python language, which uses TensorFlow. To run
some code inside the Gem5, I need a binary file of my code. Hence,
how can I run cosmoGAN Python code in the Gem5 syscall emulation mode?

* Earlier, I was interested to know how I can run a simple "Hello
World" code in Gem5 syscall emulation mode. Therefore, I posted
the following question in StackOverflow.

StackOverflow Question Link:
===

https://stackoverflow.com/questions/6344/is-it-possible-to-run-python-code-in-gem5-syscall-emulation-mode

In the StackOverflow answer, Ciro Santilli told me to implement
syscalls. I was getting an error for the "fchmod" syscall. Hence,
I implemented it in the following file
(/gem5/src/arch/x86/linux/process.cc) like below. However, it was
not working for me. The Gem5 creates a large output file, and
after that, it terminates.

Syscall Implementation:
==
{ 91, "fchmod", fchmodFunc },

* Please let me know how I can run cosmoGAN Python code (with
TensorFlow) in the Gem5 syscall emulation mode?

Thank you in advance.

Sincerely,
S.M.Shamimul Hasan


___
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

--
Best Regards,
Abhishek

___
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



http://bsc.es/disclaimer___
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

[gem5-users] Re: How to run Python code with TensorFlow in Gem5 syscall emulation mode?

2020-10-23 Thread Jason Lowe-Power via gem5-users
Hi Hasan,

I agree with Abhishek. Something as complex as tensorflow is going to be
very difficult to get working in syscall emulation mode. Using full system
mode should work (though without things like GPU acceleration, of course).

Cheers,
Jason

On Fri, Oct 23, 2020 at 1:55 PM Abhishek Singh via gem5-users <
gem5-users@gem5.org> wrote:

> Hi Hasan,
> I have been trying to run tensorflow on gem5, have you tried full system?
> I was able to run simple python code like hello on it.
> Let me know if it works
>
> On Fri, Oct 23, 2020 at 12:28 PM Hasan, S M Shamimul via gem5-users <
> gem5-users@gem5.org> wrote:
>
>> Hello,
>>
>> * I want to run cosmoGAN code inside Gem5. The cosmoGAN code is available
>> here (https://github.com/MustafaMustafa/cosmoGAN). The cosmoGAN code is
>> in Python language, which uses TensorFlow. To run some code inside the
>> Gem5, I need a binary file of my code. Hence, how can I run cosmoGAN Python
>> code in the Gem5 syscall emulation mode?
>>
>> * Earlier, I was interested to know how I can run a simple "Hello World"
>> code in Gem5 syscall emulation mode. Therefore, I posted the following
>> question in StackOverflow.
>>
>> StackOverflow Question Link:
>> ===
>>
>> https://stackoverflow.com/questions/6344/is-it-possible-to-run-python-code-in-gem5-syscall-emulation-mode
>>
>> In the StackOverflow answer, Ciro Santilli told me to implement syscalls.
>> I was getting an error for the "fchmod" syscall. Hence, I implemented it in
>> the following file (/gem5/src/arch/x86/linux/process.cc) like below.
>> However, it was not working for me. The Gem5 creates a large output file,
>> and after that, it terminates.
>>
>> Syscall Implementation:
>> ==
>> { 91, "fchmod", fchmodFunc },
>>
>> * Please let me know how I can run cosmoGAN Python code (with TensorFlow)
>> in the Gem5 syscall emulation mode?
>>
>> Thank you in advance.
>>
>> Sincerely,
>> S.M.Shamimul Hasan
>>
>>
>> ___
>> 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
>
> --
> Best Regards,
> Abhishek
> ___
> 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
___
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

[gem5-users] Re: How to run Python code with TensorFlow in Gem5 syscall emulation mode?

2020-10-23 Thread Abhishek Singh via gem5-users
Hi Hasan,
I have been trying to run tensorflow on gem5, have you tried full system?
I was able to run simple python code like hello on it.
Let me know if it works

On Fri, Oct 23, 2020 at 12:28 PM Hasan, S M Shamimul via gem5-users <
gem5-users@gem5.org> wrote:

> Hello,
>
> * I want to run cosmoGAN code inside Gem5. The cosmoGAN code is available
> here (https://github.com/MustafaMustafa/cosmoGAN). The cosmoGAN code is
> in Python language, which uses TensorFlow. To run some code inside the
> Gem5, I need a binary file of my code. Hence, how can I run cosmoGAN Python
> code in the Gem5 syscall emulation mode?
>
> * Earlier, I was interested to know how I can run a simple "Hello World"
> code in Gem5 syscall emulation mode. Therefore, I posted the following
> question in StackOverflow.
>
> StackOverflow Question Link:
> ===
>
> https://stackoverflow.com/questions/6344/is-it-possible-to-run-python-code-in-gem5-syscall-emulation-mode
>
> In the StackOverflow answer, Ciro Santilli told me to implement syscalls.
> I was getting an error for the "fchmod" syscall. Hence, I implemented it in
> the following file (/gem5/src/arch/x86/linux/process.cc) like below.
> However, it was not working for me. The Gem5 creates a large output file,
> and after that, it terminates.
>
> Syscall Implementation:
> ==
> { 91, "fchmod", fchmodFunc },
>
> * Please let me know how I can run cosmoGAN Python code (with TensorFlow)
> in the Gem5 syscall emulation mode?
>
> Thank you in advance.
>
> Sincerely,
> S.M.Shamimul Hasan
>
>
> ___
> 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

-- 
Best Regards,
Abhishek
___
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