PDA

View Full Version : Making the Most of Cell


FantasyGhost
10-31-2007, 01:31 PM
Edit: apparently it's old, dunno why they repost it as news... Updated: Monday, 22 October 2007

With programmers finding it difficult to take full advantage of PS3, tools company Codeplay hopes its new parallelism system will ease the pain.

In many respects, PlayStation 3 is an anachronism. The pinnacle of Sony Computer Entertainment’s decade-old philosophy that focuses on proprietary chip design to gain performance and long-term production efficiencies, it’s been outflanked by Microsoft’s off-the-shelf approach and Nintendo’s control-is-everything attitude. And with its main architect, one-time CEO and the father of the PlayStation Ken Kutaragi, no longer in charge, it’s likely that PlayStation 4 will be a very different beast.

Of course, in terms of the current console war, it’s still early days. PlayStation 3 remains the most powerful gaming device, as well as providing the best future-proofed option in terms of consumer electronics, although cynics might say that at its original launch price it should’ve made the tea, too.

For developers, however, the dilemma is how to make the most of its exotic configuration – notably its CPU. Even now, years after the initial interest in the design has died down, Cell’s configuration of one main processor driving eight Synergistic Processing Elements (SPEs) via what’s called the Element Interconnect Bus (EIB) makes it one of the most fascinating pieces of silicon coders can get their hands on.

For example, outside of games, researchers at the STI Center of Competence for the Cell Processor continue to publish papers with titles such as ‘Fastest Fourier Transform on Cell’ and ‘On the Design and Analysis of Irregular Algorithms on Cell’, while its use in scientific applications such as Folding@Home, as well as MMOG hosting, demonstrates its potential. One hardware integrator, Mercury Computer Systems, recently released software which enables companies to use retail PlayStation 3s to build high-performance clusters for the analysis of data from financial transactions, oil and gas field exploration, biotechnology and video compression.

Because if there’s one thing Cell is excellent at, it’s handling vast amounts of information as the EIB enables high throughput while the parallelism inherent in the SPEs means tasks can be processed very efficiently. The issue for developers is making sure information is presented in the right way.

With the exception of specific architectures such as Intel’s Streaming SIMD Instructions or PS2’s Vector Units, few game programmers have had much experience of writing well-organized parallelized code. And games aren’t the easiest pieces of software to apply to parallel hardware, anyway.

http://www.next-gen.biz/images/stories/edg182.code.cellarchitect_prev.jpg

According to Andrew Richards (pictured), CEO of Scottish programming tools company Codeplay, the problem is that games work differently to scientific work.

“We’ve looked at various parallel programming languages such as OpenMP, which is an industry-standard way of doing parallelism, but it relies on data being in arrays rather than in data structures,” he says. Incidentally, OpenMP is the basis of IBM’s own research into compilers for getting the most out of Cell. “This assumption is fair enough for scientific applications but isn’t true of games,” Richards continues. “A lot of game data is in complex data structures because game enemies don’t line up in a long line. They move around, so you need a data structure that can handle issues such as which enemies are visible at any time.”

Equally, when it comes to games, the type of processing carried out on a CPU is varied, typically involving tasks such as artificial intelligence, audio and physics calculations, as well as setting up the rendering to be sent over to the graphics card. In addition, many developers have existing engines that run to hundreds of thousands of lines of code. Retrospectively getting these into shape to get the most out of the Cell part of the equation just adds further complexity to the task.

That’s why, after originally setting up shop to offer its VectorC compiler for PlayStation 2, Andrew Richards and his team decided to take a different approach with PlayStation 3. Instead of working on compilers, which have to be written directly for each piece of hardware to automatically make your code run well, Codeplay’s solution is its general-purpose Sieve C++ Parallel Programming System, which acts as a frontend to official compilers provided by hardware companies.

“In the past we took the view that we would take your existing program and automatically parallelize it across various processors, but with PlayStation 3 we’ve come to the conclusion that what you need to do is rewrite parts of your code,” Richards says. “The trick is that we can ensure it’s a small change and one that our tools will help you make.”

{moscallout}It seems as if game coders, as well as PS3 owners, will be waiting to make the most of Sony’s hardware for some time to come.{moscallout}The Sieve system works by forcing programmers to carefully think about which areas of their code will give the best performance boost when spread across several SPEs. Once these are defined in what Richards refers to as Sieve blocks, the system will check that there are no dependencies which would stop the code being successfully spread across multiple processors. The reason it’s called Sieve is because it enables coders to sieve out data modifications from within these blocks, thus removing an enormous number of dependencies in the process.

“You need an intelligent user because this isn’t a case of shoveling something in one end and watching it come out as parallelized code at the other, but Sieve will give the programmers considerable assistance in terms of marking up their code and telling them if things can be parallelized or not,” Richards explains.

Still, as he confesses, Sieve itself remains something of a research project at present. It’s currently being sent out to various university groups and selected game companies to see how useful they find it. At best, Richards reckons it will be ready for widespread deployment in summer 2008.

In the meantime, though, there are plenty of other companies looking to provide similar smarts. Official PlayStation 3 tools provider SN Systems is working on its own Cell-based compiler technology, while US middleware company Emergent will be offering its Floodgate data streaming API as part of its Gamebryo engine; something that’s expected in early 2008. It seems as if game coders, as well as PlayStation 3 owners, will be waiting to make the most of Sony’s hardware for some time to come.http://www.next-gen.biz/index.php?option=com_content&task=view&id=7637&Itemid=2&limit=1&limitstart=1

Gegenki
10-31-2007, 10:40 PM
I wish I was a really good programmer with something to offer that needed a really powerful processor. Then the PS3 would be the perfect toy. Now its just my crummy games machine

Killing Moon
10-31-2007, 11:46 PM
The thing is, the Cell is compensating for a lack of main VRAM. So even when most developers take advantage of the processor, they’re still coming up with similar results from other consoles. It’s only causing them to take more unnecessary steps to get toward a similar base result. Had Sony simply made the RAM unified, THEN the Cell would have a significant advantage.

For now, there really aren’t any and it’s like everyone is simply making these detours for sport.

Diresu
10-31-2007, 11:47 PM
The thing is, the Cell is compensating for a lack of main VRAM. So even when most developers take advantage of the processor, they’re still coming up with similar results from other consoles. It’s only causing them to take more unnecessary steps to get toward a similar base result. Had Sony simply made the RAM unified, THEN the Cell would have a significant advantage.

For now, there really aren’t any and it’s like everyone is simply making these detours for sport.

Though its only a disadvantage for porting games...if devs did PS3 first then port to 360 it would be easier on them and that problem would go away (According to Factor5)

Killing Moon
11-01-2007, 12:07 AM
Though its only a disadvantage for porting games...if devs did PS3 first then port to 360 it would be easier on them and that problem would go away (According to Factor5)

Maybe so; I can’t necessarily say no to that.

However, there really aren’t any serious examples that prove this either. While I love Sony’s first party offerings, they’re not actually pulling off anything that couldn’t be done on a rival console.

EXCEPT KILLZONE!!!! LMAO

Diresu
11-01-2007, 12:21 AM
Maybe so; I can’t necessarily say no to that.

However, there really aren’t any serious examples that prove this either. While I love Sony’s first party offerings, they’re not actually pulling off anything that couldn’t be done on a rival console.

EXCEPT KILLZONE!!!! LMAO

I will disagree mainly based on 2 points, physics and animation.

Segitz
11-01-2007, 12:34 AM
The thing is, the Cell is compensating for a lack of main VRAM. So even when most developers take advantage of the processor, they’re still coming up with similar results from other consoles. It’s only causing them to take more unnecessary steps to get toward a similar base result. Had Sony simply made the RAM unified, THEN the Cell would have a significant advantage.

For now, there really aren’t any and it’s like everyone is simply making these detours for sport.

Do you even know what you are talking about?

Lack of VRAM? The PS3 has 256mb of dedicated VRAM, plenty for any PC game nowadays (yes, there are some games, namely Crysis, which I tested myself, which can use more, but PC programming has a completely different paradigm) and surely "enough" (always if used correctly) to have good results. They can even use the XDR RAM for GPU usage, with a small latency penalty.

The problems don't lie within the RAM (speaking of 360 ports), they lie within cell and the RSX. Since the RSX has no eDRAM and Cell is not a SMP CPU, porting code from the 360 mandates complete rethinking of how you thread your code... ... ...

This has been talked about too much the last year^^

LiquidEagle
11-01-2007, 01:11 AM
Hehe... Codeplay sounds like Coldplay... that's the only thing I have to submit to this conversation :-p

Killing Moon
11-01-2007, 01:30 AM
Do you even know what you are talking about?

Lack of VRAM? The PS3 has 256mb of dedicated VRAM, plenty for any PC game nowadays (yes, there are some games, namely Crysis, which I tested myself, which can use more, but PC programming has a completely different paradigm) and surely "enough" (always if used correctly) to have good results. They can even use the XDR RAM for GPU usage, with a small latency penalty.

The problems don't lie within the RAM (speaking of 360 ports), they lie within cell and the RSX. Since the RSX has no eDRAM and Cell is not a SMP CPU, porting code from the 360 mandates complete rethinking of how you thread your code... ... ...

This has been talked about too much the last year^^

Yeah, it has 256MB of VRAM, but the ram is already cut due to a bigger memory footprint. So no, already it DOESN'T have 256MB right then and there.

Furthermore, you can't use the other "available" 256 for anything like storing textures, meshes, etc. It's all for code alone and quite frankly pissing off a lot of my colleagues, LOL

I'd honestly have to say that working w/ the 360's ram, it being unified is a god-send. You can use any amount for art assets and distribute whatever amount you need for physics, AI, etc. There really isn't a reason why everyone should be forced to rethink their manner of coding just for the sake of ONE console alone. Especially if they're not being paid exclusively. Although you could use the argument of saying that the PS3's processors can be used solely for physics. Which is nice, but not a great way to make up for the other major bottleneck, thereby creating no significant advantage [so far].

BTW, the supposed claims that the PS3 games are superior physics wise has yet to be proven also. I'm not saying that they WON'T be, but it's all smoke as of right now.

Diresu
11-01-2007, 01:46 AM
BTW, the supposed claims that the PS3 games are superior physics wise has yet to be proven also. I'm not saying that they WON'T be, but it's all smoke as of right now.

Based on Motorstorm alone, I have to disagree.

Killing Moon
11-01-2007, 01:47 AM
Based on Motorstorm alone, I have to disagree.

Colin McRae DiRT!
See what I mean?

Diresu
11-01-2007, 01:48 AM
Colin McRae DiRT!
See what I mean?

No, actually. I didn't really see anything that great in it. Even if as you say there is no hard proof...though I still disagree with that, animation is a clear step ahead of the rest, and some could argue scale as well.

Segitz
11-01-2007, 02:01 AM
Furthermore, you can't use the other "available" 256 for anything like storing textures, meshes, etc. It's all for code alone and quite frankly pissing off a lot of my colleagues, LOL

I'd honestly have to say that working w/ the 360's ram, it being unified is a god-send. You can use any amount for art assets and distribute whatever amount you need for physics, AI, etc. There really isn't a reason why everyone should be forced to rethink their manner of coding just for the sake of ONE console alone. Especially if they're not being paid exclusively. Although you could use the argument of saying that the PS3's processors can be used solely for physics. Which is nice, but not a great way to make up for the other major bottleneck, thereby creating no significant advantage [so far].

BTW, the supposed claims that the PS3 games are superior physics wise has yet to be proven also. I'm not saying that they WON'T be, but it's all smoke as of right now.

Whoa... there are MANY people, especially people who really work with the PS3, that WILL disagree with you on this one. Just read about it at B3D forums... All PS3 devs say, you can use the XDR for anything the RSX can do with it.

The UMA from the 360 is good from a devs point, no question... But it is crippled, because of its small bandwidth (only 128bits AND shared with the CPU which may get starved by or can starve the GPU). Yes, the eDRAM makes up for it, but not completely (without it, the 360 would be a rubbish design really).

Rethink designing? What are you smoking? Did you ever look at pcs? They also have dedicated RAM for the GPU and shared for CPU and GPU... That is EXACTLY the design a PC has (and a PCs connection between RAM and GPU is much slower than in the PS3). I find it intersting, that the 360 is more of a supercharged PS2 than a XBox^^ The PS2 also had eDRAM and a UMA-ish design.

And this stuff is not what makes porting 360 to PS3 the main problem. The difference in RAM (40 or what is it now?) is negligible (sp?). The problem is mainly the CELL and its different architecture. The RSX (performancewise) is identical to the XeGPU, so and games like Madden are surely no graphical benchmark, so my guess is, the CPU is the culprit.

Killing Moon
11-01-2007, 02:05 AM
Whoa... there are MANY people, especially people who really work with the PS3, that WILL disagree with you on this one. Just read about it at B3D forums... All PS3 devs say, you can use the XDR for anything the RSX can do with it.

The UMA from the 360 is good from a devs point, no question... But it is crippled, because of its small bandwidth (only 128bits AND shared with the CPU which may get starved by or can starve the GPU). Yes, the eDRAM makes up for it, but not completely (without it, the 360 would be a rubbish design really).

Rethink designing? What are you smoking? Did you ever look at pcs? They also have dedicated RAM for the GPU and shared for CPU and GPU... That is EXACTLY the design a PC has (and a PCs connection between RAM and GPU is much slower than in the PS3). I find it intersting, that the 360 is more of a supercharged PS2 than a XBox^^ The PS2 also had eDRAM and a UMA-ish design.

And this stuff is not what makes porting 360 to PS3 the main problem. The difference in RAM (40 or what is it now?) is negligible (sp?). The problem is mainly the CELL and its different architecture. The RSX (performancewise) is identical to the XeGPU, so and games like Madden are surely no graphical benchmark, so my guess is, the CPU is the culprit.


Dude, I'd agree with you on many levels. But when you hear the frustration on a daily basis, it begs to wonder what the main problem is out of the equation. This is the general consensus from a lot of the artists and programmers along my way, really.

lips
11-01-2007, 02:19 AM
oh gosh, what did I stumble on here? could just add edram may not be such a grace as it requires tiling for hd + aa and therefore doubly exhausts said limited resources... ofcourse this is just to get in ... before ....... lock!!!!

Segitz
11-01-2007, 03:08 AM
Dude, I'd agree with you on many levels. But when you hear the frustration on a daily basis, it begs to wonder what the main problem is out of the equation. This is the general consensus from a lot of the artists and programmers along my way, really.

Hehe^^

ok then. The "frustration" we hear are almost always multiplat devs with a 360 lead platform. Guess what, many devs (who programmed the other way round) say, that it is easier to port from PS3 to 360 (new interview at gamasutra from a Stranglehold dev states so too). But looking at other games like CoD4 make these complaints turn into dust somehow. Same goes for first party games like GT5P, RnCF or Uncharted. These games really show, what the PS3 can do and what other would be able to do, if they handled stuff differently.

In the recent Naughty Dog interview, the dev said, they started from scratch producing Uncharted. I really really doubt studios at EA are even remotely allowed to do so by their managers. I know that not all devs have the ability to start stuff from scratch, but if they won't, they have absolutely no right to complain about a "the PS3 being bad".

The PS3 is a very different beast. It is like comparing a fast lap in a Smart ForTwo to one in a Audi RS4. They need to be driven differently to achieve the fastest times. (oh man, sometimes it is really hard to come up with car comparisons^^). You cannot just floor the pedal in either car (well maybe in the smart, when driving an oval course, as it is artificially limited to 130km/h^^), you need to learn the car to get the best out of it. This is the same with the CELL. You cannot just put any code on it, and hope it will run full speed on it.

lips
11-01-2007, 04:58 AM
Hehe^^

ok then. The "frustration" we hear are almost always multiplat devs with a 360 lead platform. Guess what, many devs (who programmed the other way round) say, that it is easier to port from PS3 to 360 (new interview at gamasutra from a Stranglehold dev states so too). But looking at other games like CoD4 make these complaints turn into dust somehow. Same goes for first party games like GT5P, RnCF or Uncharted. These games really show, what the PS3 can do and what other would be able to do, if they handled stuff differently.

In the recent Naughty Dog interview, the dev said, they started from scratch producing Uncharted. I really really doubt studios at EA are even remotely allowed to do so by their managers. I know that not all devs have the ability to start stuff from scratch, but if they won't, they have absolutely no right to complain about a "the PS3 being bad".

The PS3 is a very different beast. It is like comparing a fast lap in a Smart ForTwo to one in a Audi RS4. They need to be driven differently to achieve the fastest times. (oh man, sometimes it is really hard to come up with car comparisons^^). You cannot just floor the pedal in either car (well maybe in the smart, when driving an oval course, as it is artificially limited to 130km/h^^), you need to learn the car to get the best out of it. This is the same with the CELL. You cannot just put any code on it, and hope it will run full speed on it.

and then you have the longevity of the recently realized 'leap of faith'

really, a better note might be if a game such as halo 3 was best designed for xbox 360, whose expressed power lies in direct aa in edram, how could a game with no aa be best suited for such hardware?????

cpiasminc
11-01-2007, 08:59 AM
Yeah, it has 256MB of VRAM, but the ram is already cut due to a bigger memory footprint. So no, already it DOESN'T have 256MB right then and there.
Well, yeah, that's the OS. And my experience with the PS3 has generally been such that the OS, the XMB-based systool hooks, and some of the API layers that Sony provides are the biggest thorns in my side. Cell itself doesn't bother me that much. The SPUs in particular do surprisingly well on the very things you'd think they'd suck at. Usually, I can take code that should be terrible, but even those things on an SPU run quite a bit faster than the PPU or 1 Xenon core. Obviously, there are some things which we can't really do on the SPUs (e.g. runtime dynamic binding, unless you do it manually), and some part of that is just the obscene number of active PPU threads at any given time.

What confuses me is the comment that Cell is compensating for this lack of VRAM? How so? Technically or just in terms of marchitecture?

There really isn't a reason why everyone should be forced to rethink their manner of coding just for the sake of ONE console alone.
As much as one can make the argument that we'll anyway be forced to rethink closer to Cell-like in the long run and that such rethought is beneficial on multicore PC and 360, the other side of this coin is that the 360 is clearly designed with the needs of a current-day console platform in mind, whereas PS3 clearly isn't. You can look at both consoles and just see the anachronism of PS3 and the "right now" approach of 360.

BTW, the supposed claims that the PS3 games are superior physics wise has yet to be proven also. I'm not saying that they WON'T be, but it's all smoke as of right now.
Well, I don't know about *superior* unless you're working on an exclusive (which we're not, so it's kind of pointless for me to look for that), but we're yet to hit an example within physics where the Cell doesn't run at least 70% faster than anything else. That too, with significantly less effort to optimize, but then we followed the example of doing certain things on PS3 first, and multithreading was one of those.

Nameless
11-01-2007, 09:05 AM
^ CPI good to see you posting again.

Killing Moon
11-01-2007, 03:28 PM
The PS3 is a very different beast. It is like comparing a fast lap in a Smart ForTwo to one in a Audi RS4. They need to be driven differently to achieve the fastest times. (oh man, sometimes it is really hard to come up with car comparisons^^). You cannot just floor the pedal in either car (well maybe in the smart, when driving an oval course, as it is artificially limited to 130km/h^^), you need to learn the car to get the best out of it. This is the same with the CELL. You cannot just put any code on it, and hope it will run full speed on it.
Heheh, NOW you're speaking my language. :-D

cpiasminc
11-01-2007, 05:12 PM
To add to this part --
And my experience with the PS3 has generally been such that the OS, the XMB-based systool hooks, and some of the API layers that Sony provides are the biggest thorns in my side.
Microsoft makes some truly evil APIs as well, and have TRCs which are clearly the products of malice. DirectInput, for instance, was created out of a desire to inflict cruelty on developers and they figured that mass rape and torture and other such methods wouldn't be feasible from a time and cost perspective. But the difference is that MS documents even those well enough that you can still eventually figure out what you need to do.

Sony, otoh, has loads of errata and missing information in their docs, and a load of cyclical explanations for things. e.g. "listParam is the list parameter. This serves as the parameter for the list." Seriously... what the hell is that supposed to tell me? And to add to that, not even Sony's support lines know what it does.

Nameless
11-01-2007, 05:35 PM
^ When you think about how long MS has been in the software game with OS support they should be better suited for providing developer documentation...

LaLiLuLeLo
11-01-2007, 05:36 PM
Pwned.

cpiasminc
11-01-2007, 08:10 PM
When you think about how long MS has been in the software game with OS support they should be better suited for providing developer documentation...
Having people whose mother tongues happen to be English also helps so that you don't find stuff about "short parametersu" and "early cancering of jobs" ;). Though in at least the few cases I've looked up, the Japanese docs are every bit as useless and full of details that are out of date.

Microsoft on the other hand, sometimes updates the docs before the software. I've often run into the problems where the docs tell me this, that and this, and when it doesn't work, they tell me "Oh that, that will be out in the next update... I'm thinking... probably a month or two from now?" This is only a problem if you download docs separately from the SDK updates, of course... which is generally something you tend to do with TCR docs.

Pwned.
??!?!??? o___O

LaLiLuLeLo
11-02-2007, 06:32 AM
You, by Sony's erratic OS support and file...thingamajigger.