Python?

Forum for anything not suitable for the other forums.

Python?

Postby markd » Fri Dec 21, 2012 5:07 pm

Is anyone working on or interested in Python on the Epiphany cores?
I don't know if the interpreter will fit in < 32K, but it would be interesting to try.

The Python interpreter will add overhead, and probably consume a fair amount of each core's memory, so it would be more limited compared to straight C or OpenCL. But it would make an easier path for programming the hardware.

Mark
markd
 
Posts: 11
Joined: Mon Dec 17, 2012 3:28 am

Re: Python?

Postby Gedece » Fri Dec 21, 2012 5:34 pm

I'm interested, but as you pointed, it could be not very usefull.
User avatar
Gedece
 
Posts: 23
Joined: Mon Dec 17, 2012 3:18 am
Location: Buenos Aires, Argentina

Re: Python?

Postby fredd » Fri Dec 21, 2012 6:17 pm

I think it would be interesting to run python on the host side, and then use a cython/pyopencl style library to include Epiphany c code "kernels" in a python script, and map shared sdram as numpy arrays. In that way the entire process of compiling epiphany code, sending input data, running Code and retrieving and presenting results could be described in a single file.

I'm definitely interested in writing/contributing to that python library!
fredd
 
Posts: 12
Joined: Wed Dec 19, 2012 1:09 pm

Re: Python?

Postby markd » Tue Jan 01, 2013 6:04 am

For a small python interpreter, Python-on-a-chip (p14p) ( http://code.google.com/p/python-on-a-chip/ ) looks interesting.

First step is to get it compiled for Epiphany and running on the emulator.
markd
 
Posts: 11
Joined: Mon Dec 17, 2012 3:28 am

Re: Python?

Postby piotr5 » Tue Jan 01, 2013 3:28 pm

55k seems a bit too much for the 32kb cached memory, guess we need to find a workaround for the memory-limitation. for example compile in such a way that some parts are re-located at runtime? somehow the usualy cache-mechanism needs to get emulated here. but also the "8KB is the minimum recommended RAM." sounds a bit too much here, when we have only 32 for program and data and stack and whatnot...
piotr5
 
Posts: 230
Joined: Sun Dec 23, 2012 2:48 pm

Re: Python?

Postby ed2k » Sun Jan 06, 2013 5:32 am

interesting, saw a clone on google code. Any progress to share?
ed2k
 
Posts: 113
Joined: Mon Dec 17, 2012 3:27 am

Re: Python?

Postby markd » Mon Jan 07, 2013 5:45 am

Yes, there is some progress. I pushed some code to a clone of python-on-a-chip:
http://code.google.com/r/markdewing-epi ... e/checkout

It is enough to compile for Epiphany and run the PyMite interpreter on the simulator.

Steps to run:
1. Download/checkout the code
2. Be sure to be running Python 2.6. (Build system will not work if running 2.7) You might need to compile and install it, preferably somewhere out of the way so it doesn't interfere with the system python, and then put that place on your path.
3. Make sure the E-SDK is on your path
4. Build with 'make PLATFORM=epiphany all'
5. Run an interactive session with 'make PLATFORM=epiphany ipm'

The version built by default uses more than 32K. It is possible to make a version that uses less than 32K, but it requires removing nearly all the features defined in src/platform/epiphany/pmfeatures.py (including, unfortunately, floating point support). For the sake of getting something working, I may target 64k for interpreter+code+data (leave one core out of two idle).

Tentative next steps are to work on the programming model.
- First, I'll try implementing a very minimal subset of numpy arrays (nano numpy?)
- if that works, I'll try extending those arrays to coarrays. Coarrays seem like a natural fit for the Epiphany memory model.

Ultimately, it would be nice to compile the python kernels to object code - this would remove the space and performance overhead of the interpreter on each core. Given that the cores will probably be running a very restricted subset of Python, this should be relatively easy. Particularly with LLVM - assuming someone is making an LLVM backend?
markd
 
Posts: 11
Joined: Mon Dec 17, 2012 3:28 am

Re: Python?

Postby ed2k » Tue Jan 08, 2013 4:58 am

nice, after struggling with the python2.6 installation on my ubuntu, pymite running on epiphany simulator now. will try to see how to strip the interpreter. But I remember seeing on the wiki that it is already stripped out, since ipm is running on host, and could send compiled obj to pymite.
ed2k
 
Posts: 113
Joined: Mon Dec 17, 2012 3:27 am

Re: Python?

Postby Gedece » Tue Jan 08, 2013 2:33 pm

shouldn't we start/move this sort of conversations into the Python forum?
User avatar
Gedece
 
Posts: 23
Joined: Mon Dec 17, 2012 3:18 am
Location: Buenos Aires, Argentina


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 6 guests

cron