Showing posts with label philosophy. Show all posts
Showing posts with label philosophy. Show all posts

Monday, 16 April 2018

So long and thanks for all the fish!

This will be my last post to a-hackers-craic!

I've moved all the posts and images to http://www.zedzone.space/blog, although how they look and how they work are still very much work in progress. I had already moved most of http://users.on.net/notzed to http://www.zedzone.space yesterday.

Some things might be broken for a while but everything apart from comments should have already made it across intact.

Byeee.

Friday, 20 November 2015

time is an illusion

But so is reality so it doesn't make any difference.

I've got too much of it to fill with boring tedium either way.

Wednesday, 22 July 2015

the risk of centralisation

So I don't really have much to say here but this is mostly just to add a "see, that's what happens" with regards to an apparent on-going problem with sourceforge.

I noticed a maintenance message a couple of times in the last few days and just put it down to being on the wrong side of the world as per usual; but it seems they've had some disk failures and restoring a site of that magnitude to full functionality isn't a trivial task.

Of course, the catch-cry is to use github, but that is also at the whim of hardware faults or just economics (as in the case of google code's demise), and savannah isn't immune to either. This also holds for blogger and wordpress and all these other centralised services, whether they be 'free-but-you-are-the-product' ones or paid services.

Not that I think the software i've been playing with has any intention to be the solution to this problem but decentralisation is an obvious answer to managing this risk. It may mean individual sites and projects are more susceptible to overload, failure, or even vanishing from history; but by being isolated it better preserves the totality of the culture represented in these sites and projects. Economically it may also be more expensive in total but as the cost is spread wider that concern just doesn't apply (parallelism and concurrency is wonderful like that).

I was already focusing on my current software project being 'anti-enterprise' - not in an economic or political sense but in an engineering sense - but events like this encourage me.

Wednesday, 10 September 2014

Boycott nvidia, cuda?

nvidia has taken the nuclear option to sue every other gpu maker in existence (apart from ati/amd with which they already have cross-licensing agreements i guess).

Patent trolling is usually the last gasp of a failing business. Which implies that despite (or because of) their overpriced hardware they are failing as a manufacturer; GPus are now commodity items and the margins no longer exist to run their type of high-margin business.

Patents are a cruel abomination which distort the workings of a "free market"; they directly codify rentier behaviour which costs society both economical and technological progress. The only beneficiaries are the unproductive leeches of society at the cost of everyone else.

If you're an engineer or scientist who is currently using or considering cuda for your work I suggest you reconsider both to protest this failure of a strategy and to protect the future value of your work.

Just for nvidia to consider this strategy shows they are not long for this world and choosing to use such a single-supplier would be foolhardy.

Thursday, 7 August 2014

On my god, it's full of local binary patterns!

I recently had need to look into feature descriptors. I've previously played with SURF and looked into others but I wasn't really happy with the complexity of the generator and needed something Java anyway.

A small search turned up FREAK (why the silly 'catchy' acronym names? Maybe it started with S-USANs?) which looked doable so I had a bit of a play. There is code available but it's OpenCV and C++ and the version I saw just wasn't very good code. I wrote up my own because I had some different needs for what I was looking at and porting the C++/OpenCV was going to be a pain.

I guess they work as advertised but i'm not sure they're what I want right now. I tried porting the AGAST detector as well but it wasn't really getting what I was after - i'm after specific features not just 'good features'.

The paper does include this interesting diagram though:

Although the paper doesn't reference them this diagram is pretty much a description of local binary patterns. The FREAK descriptor itself is just a very long local binary pattern with optional orientation normalisation.

Perhaps more interestingly is that this specific diagram could just as well be a description for how my fast object detector works. It is effectively a direct implementation of this diagram.

Assuming the above diagram is representative of human vision I guess one could say that the whole of visual reality is made of local binary patterns.

Tuesday, 4 February 2014

Is VR really a good idea?

It looks like the technology is just about there to create affordable and usable 'virtual reality' hardware for the general public: but as with many other technological advances one has to ask whether the technology is ahead of society's ability to cope.

TV is already a pretty good conversation killer and mobile phones have become little cones of isolation even when "socialising" with friends or family, so how will it play out if you're whole field of view (and hearing?) is encased in a helmet?

I can see a lot of agro from brothers and sisters fighting over the one head-mounted display that these things will only be able to support for the time being. And some angry mums when little Johnny or dear little Alice wont come out of his or her bedroom for dinner because he can't even hear the calls (and god knows what they're up to in there). And some pretty boring get togethers with mates around the TV getting sea-sick looking at a view from the one player's eyes.

Another more disturbing factor that will play into it is the continual fine tuning of the skinner box trade - games which are pretty much just poker machines / gambling devices for extracting money from the vulnerable. Since those are making such a fuck-ton of money at the moment they are only going to get worse. If people can already get lost in a tiny screen on a phone how will they cope when they're shut-off completely from the outside world? The scope for manipulation of vulnerable or susceptible people is enourmous. It's easy to blame people as being weak-minded but it's not entirely their fault: they are being manipulated without even knowing it, but intentionally by maniplators who know what they're doing.

Or propaganda / religious / idealogical indoctrination, both scurges of right-thinking citizens everywhere. Cut off from immediate self-correcting factors like someone telling you what a dickhead you are.

As an aside I wonder when hollywood became such an obvious propaganda front for the neocon/zionist agenda? One of the recent transformers movies was on the other night on TV and I couldn't get over just how blatantly propagandist it was at every level: an [unemployed] 'nerd' who saves the day, with a super-model girlfriend, with happy middle-class parents, with nothing but leisure to keep them occupied, government secret organisations [being a good thing, by] protecting the [whole] world from bad stuff [that usually happens in the middle east], to advanced alien race only wanting to deal with the USA [who are obviuosly the good guys], even to some [crazy] conspiracy nut not only being believed by everyone but also being incredibly wealthy. I guess we had some of that shit in the 80s and 90s but at least we had some stuff to counter it too (and a bit of fucking humour) and now it's just so overt it's bordering on sick. Although it's been an undercurrent for some time I suppose it was around the turn of the century it really took off so brazenly by taking advantage of public maleability at the time. And the really sick part is they get upset when people don't want to pay to be advertised at and brainwashed (or maybe the sick part is people want to go to the effort to get it in the first place). But I digress ...

Back to the VR stuff: potential health issues. Spending many hours staring at a screen with a fixed focal distance can't be good for your eyes. Modern lifestyles are already sedentry enough and the lack of external vision enforces this even further as you don't have a choice but to sit while doing it unless you live in a rubber room. And if socially retarded people (like me) can already get caught up in reading books or hacking code well into the next morning what's going to happen when you can't tell if it is night or even know where you are? I wonder how long until someone dies using one? Or loses their job/fails at school because they'd rather spend time outside of IRL, because lets face it, IRL pretty much sucks for most people at least some of the time. Although it's not like both of these don't already happen with existing technology.

And imagine not being able to skip adverts or mute them - or even look away from them? That's nightmare material.

There are some potentially interesting non-game uses that spring to mind which seem to contradict some of these points such as remote communication or stuff for mobility impaired (whether through age or disablement). And others such as training. But most of these will be short-term or irregular.

But overall i'm just not sure on the whole idea for entertainment itself. It could be totally bloody awesome or it could be the beggining of the end for western civilisation (civilisations never last forever ...). Ok probably not the latter but there are big issues beyond the technology capability itself and those explored by some laughably fantastical stories by Neal Stephenson.

It'll certainly be interesting for a while anyway - a new area of technlogy to explore. Don't get me wrong there are some really exciting possibilities for games and other uses that i'm looking forward to trying out one day. But in the end there may need to be mandatory breaks, minimum age restrictions, ambient input (e.g. external cameras or see-through screens/windows) or other tweaks just to protect people from themselves.

I guess we'll see in about a decade, assuming the experiments in the next few years become commercially successful.

Tuesday, 26 March 2013

Another pointless bruhaha at an IT conference

I just have 2 words to say: Google Glass.

Better get used to it, and more.

Friday, 1 March 2013

The brain dump

Last night I was pretty exhausted - the neighbours had some bricks delivered around 7am which woke me too early after what was a pretty lousy night of sleep. I got up with the idea of turning off the watering system (starts at 7am) after it had done the pot plants and kind of forgot about that and ended up hacking for nearly 15 hours straight.

Ok so it was probably a bit obsessively intensive, but i'm pretty surprised I still get such a level of buzz out of hacking code after 25 years of doing it for fun. In terms of effort and intensity, it could have been any other xmas holiday from any of those previous years. On the other hand i'm writing more and better code than ever before because the platform is fuller than ever before. The only downside is that I can't keep up the intensity for as many consecutive weeks as I used to and end up with aches and pains from sitting still for so long.

But as I intended to take a bit of a break for a few days I thought i'd jot down some feature ideas, todo's and wishlists in my engineering notebook (a paper one) while the ideas were still hot.

As I wrote things down my memory started to vanish very rapidly - as if waking from a dream. I got the main feature points down fairly completely but I was pretty stumped at the todos. Although only minutes before I had a mind full of all those little refactoring, renaming, and tweaking ideas for improving the codebase, by the time I went to write them down I drew a near blank. I've experienced something similar before when I left the Evolution project; as I wrote all my knowledge down all the anxieties from keeping track of the 'known bugs' and 'future plans' in my head just melted away. But it wasn't quite so abrupt, although both instances were very cathartic. To be honest i'm still surprised I can keep so much in my head for weeks at a time - when I often forget where I put a screwdriver only a minute prior.

So it was a very good idea to write it down and let me get a good nights sleep. And although my brain is now bereft of most of the details I managed to write most of them down, and i'm sure the others are in the source as FIXMEs or will come back when I get into it again - if they were important.

Wednesday, 6 February 2013

It's all down-hill from here ...

I'm a couple of weeks away from being officially 'middle aged', although it doesn't really feel any different from any time in the past 5 years or so. Probably not surprising as nothing has really changed in that time. I guess mainly i'm not going out as much and not riding anywhere near as much but otherwise i'm about the same weight/fitness, same grey/hairline and have a similar set of aches and pains ...!

One thing hasn't changed in a very long time is my cynicism in general - one nick-name at work back in the late 90s was 'Grumpy' - although these days i'm less reticent about verbalising it as bluntly as I feel like at the time.

However one thing in particular I'm getting more and more disillusioned with is the state of technology in terms of software. Despite enormous advances in hardware and information and cost, we still basically have software at about the same level of shittyness as we always have. If anything, it's worse due to the sheer volume of mediocrity dragging the bell curve down. Together with particularly stupid ideas like HTML5. Whilst there are a few gems I believe the core problem is the complexity of software. It just keeps going up - which just means software is always playing catch up and never reaching maturity.

Some people seem to really get off on this constant change - like a manipulative game which doles out worthless rewards piecemeal in order to turn your learning-by-play-for-survival instincts against you - mostly worthless incremental improvements or often just 'change for change sake' which seem to get people overly excited. But we've all seen this shit before - if everything gets better ever release then it must've been pretty shit to start with, and with a certainty whatever we have now will be shit compared to the future, so why all the excitement? It might appear to be rapid progress but in reality it's just spinning the wheels.

This complexity and constant (but in reality unmoving) change is really just a competitive tool to manipulate the public. Think of the fashion industry. On the surface it is vibrant and active but in reality nothing really changes and it just goes around in cycles and it's all about marketing and extracting money.

For example over the last 15 years i've seen an awful lot of man hours go into every system, but the differences to a 15 year old desktop computer are really quite minimal outside of details and performance due to hardware improvements. What improvements there are are really despite the software side of things not because of them.

So here's a few thoughts and rants on many topics in no particular order:

Apple mini ipad
Big mistake. After big jobby's filing-fingers comments it had to be something special, and a low-res screen/underpowered for the time hardware is not it. This severely tarnishes the 'best of the best' premium brand Apple likes to project and is the start of relegating them back to the niche from which they came. After all the "retina" bullshit it really had to have at least that + upgraded cpu.
Microsoft
Lots of stupid mistakes. Phone is a complete disaster, although bringing down Nokia and QT was a good move on their part (removing a huge chunk of the competition - if it wasn't illegal it surely should be). RT is a complete disaster.

Surface PRO is a dumb idea - mostly because it competes with their own customers even if it ever does sell. Which I don't think it will - it's just an overpriced underpowered machine which can't make up it's mind what it is. A business would be better off with a netbook and the general public just wants a dumb appliance.

Unlike some weak willied saps I don't mind saying I hate Microsoft. They set the tech world back at least a decade with their junk and illegal shenanigans and they continue to interfere outside of the open market. And if you don't think that isn't a valid reason for 'hate', I think you need to re-evaluate your value system.

Android
I wish it was a proper GNU/Linux and I wish it was a proper Java. After some initial 'wow, neat', my thoughts have definitely cooled based on it's limitations and roadblocks. It suffers greatly from being designed for 5+ year old hardware whose assumptions no longer hold even for a $50-outright phone.
Google
Google is NOT the friend of free software or 'open sauce'. They are just a user and abuser of it and their customers in general. I wish more in the free software world recognised this. They only contribute when they're legally required or where it suits them commercially or for marketing purposes. Which obviously works well.

They're also a general proponent of the "fuck the user, we know best" mindset which is infiltrating all of IT. Not that I don't sympathise with this substantially, but i'm not the one trying to win over and influence people.

ChromeOS
Yay, thin clients all over again.

Yay, netbooks all over again.

World has been there before. Even battery powered ARM devices are getting powerful enough now they can do much more than run lightweight frontends to network services. Well they could if the frontends were lightweight and not supporting such a heavyweight framework as ...

HTML5
This will be one of the biggest sinks of money and man-power in tech-history. The multi-national software vendors are just using it as a weapon to keep their competitors occupied whilst they cement their own technology. It is now so complex and large it may never be possible to create an implementation of sufficient quality and interoperability. Problems which have forever plagued the net since the first clone of NCSA Mosaic was made will never be resolved. The web is becoming more closed than ever - more and more sites are 'chrome-only' or 'firefox-only', and then only with the absolutely latest versions.
FirefoxOS
See ChromeOS.
SystemD(OS)
The authors don't like Unix and want to create their own clone of Apple's operting system. Sure why not, but why do they have to fuck up a GNU/Linux system to do it? Apart from the ego trip it seems to be about proprietising their brand of Unix and stealing a customer base from what used to be a different product.

Next time I "upgrade" or install a system it will probably be slackware (if i have the choice on the hardware in question, I am hoping it is ARM based). Whilst i'm still using Fedora on a few machines they will not be installed with anything more recent than the already dated version they have.

Java
Oracle need to make the browser plugin free-software or face it's extinction as a platform for Java delivery - not that it isn't that far off at this point. Mostly for security reasons but also for cost and platform support.

The browser plugin has been a PR disaster, but one must also temper it with the fact that for Mozilla, Google, and Apple - Java is a direct competitor. It is in their interest to make it appear as scary as possible as well - and they're sparing no effort there.

At least the GNU/Linux support for Java is finally absolutely first class and in some cases arguably the best of all platforms. As a developer this creates great freedom - it doesn't matter which GNU/Linux distribution I use for development, or which proprietary os the customer does. For me Java is the 'platform', making the system it runs on irrelevant.

JavaFX
Apart from the media stuff which sucks about as much as every other media api ... ever ... it's looking great. The Android and apple versions must be released for free (in terms of cost at least) - there's no real money (of the sort Oracle could justify) to be made in development toolkits anymore and there hasn't been for a very long time.
ARM
Just going from strength to strength. The A15 and big/little stuff looks very exciting but I really want to see some micro itx form-factor machines with desktop-class i/o and memory and first-class GNU/Linux support. The mobile/low power i/o & memory stuff is really hampering the performance where battery power is not an issue and too many machines are just disposable android computers.

There is far too many proprietary parts to ARM SOC's though - including the CPU itself.

Netbooks
Apparently ASUS is dropping them. Apart from some obvious microsoft influence on the decision ... I really just think it comes down to margins for the manufacturers. A cheap product doesn't make much money and with margins so thin in the industry already it just doesn't make any sense for them. Just add a bit more hardware and call it an 'ultrabook' and sell it for a much higher margin instead ...

Presumably we'll be able to get cheep/small laptops intended for the Chinese market for some time to come though, so they will never really 'die'.

Python
Anytime I see a GUI app written in python it just makes me groan. Whilst there are are couple of OK ones in general they remind me of AMOS basic back in the day, or tcl/tk. Sure you can write applications with it but in general they're shit and even the really good ones are noticeably less than the best on the platform. I figure this is mostly because the sort of people who choose python choose it because it's "easy", which means they're probably not very good coders to start with - because it's really no different to any other language. Still can't even do threads ffs.
AMD
Good hardware, software getting better, but I just don't know what's going on there. Can they deliver with their grand plans of the HSA? Don't know, don't know. HSA is very exciting but I'd be more comfortable if it wasn't a consortia of a who's who of the also-rans of the multinational user-abusing elite.

If it isn't some ARM SOC, I want my next laptop to be a GCN based APU with full GNU/Linux support but i'm not holding my breath (and with 2 thinkpads which are still kicking along fine, i'm in no rush).

OpenCL
Whilst I think it's fun and cool, it's still not ubiquitous enough for software developers to rely on. Its also too hard for most modern developers who just don't seem to be very good at their jobs to start with. I'm not sure if this is because programming has been dumbed down too much (when we did software engineering 1 at uni, the whole mantra was that coding was so boring it should be given to low-cost code-monkeys and only the high level design mattered - but that wasn't true then or now), poor education, people are just too lazy, there's better money for the type of people good at it elsewhere, or some other reason.

Still - regardless of all that it is too hard and too costly to develop for OpenCL in general so improvements need to be made somehow. Ideally something like the Sumatra project in openjdk together with project lambda which makes it relatively transparent.

The HSA stuff is the widest industry push for something a bit more substantial to try to break the homogeneous multi-core mould - intermediate bytecode, support for more languages and an UMA for cheap cross-processor calls. Still to be honest - more than one cpu scares the willies out of most programmers so I think even that is likely to be too much to ask.

OTOH computers are so fast these days single core programming is more than adequate for the majority of processing tasks anyway.

Time
... is an illusion, lunch time doubly so. I think time is not a dimension but merely a measure of passing state. i.e. one can only travel forward in time at a fixed-rate (relatively) as the only state which exists is 'now'. This does away with nonsense like parallel universes required otherwise. Whilst general relativity is a great model of the universe which fits many practical problems, like every other model it is only a model and not the mathematics and machinery on which reality actually executes. No matter how fine or reliably the measurements match.

Not that I have any evidence for it, I suspect that the universe is infinite of age and size and the popularity of the big bang theory (and most of cosmology in general) has it's roots more in Abrahamic theology than in hard science. After all a big bang still needs a starting point and cause.

I don't believe FTL travel will ever be possible, and humans will never leave the solar system (too much energy required). Stephen Hawking and their ilk dreaming of a star-spanning future for humanity is no better to me than believing in the sky faery of an Abrahamic god, or that advanced (i.e. god-like) aliens will save the day.

The earth
We only have one world, we'd better work that out soon or be doomed. I don't hold much hope. Humanity has been given a cruel legacy from it's evolution - it is just too effective at breeding and controlling the wild environment that it will clearly consume all resources before it learns to live within it's means. And the only practical solutions are too morally objectionable to be contemplated - i.e. population control. Our evolutionary training has even ill-equipped us for a modern world of relative safety and internationalisation.

Of course given we are on a single planet the population will be controlled one way or another by itself - famine, epidemics of disease, natural disasters, man made disasters, accidents, wars.

We're already seeing nature fighting back - anti-biotics will no longer work effectively very soon and the results will be catastrophic, perhaps cataclysmic. This will happen in my life-time. In the past individual groups might have died out or be decimated by localised disasters, but we will clearly face global catastrophes in the not-too-distant future. I suspect at some point in the not-too-distant future many of the hailed medical advances of the 20th century - antibiotics in particular - will be seen as a near fatally-dangerous mistake.

Whilst I reckon life is widespread throughout the universe (just look at how widespread it is on earth - anywhere with water + energy = life), "intelligent" life may itself be an evolutionary dead-end.

free will
I'm not sure whether free will exists or doesn't, but any system as complicated as any animal is so chaotic it probably makes no practical difference no matter what the physics suggests.

But I am convinced you have no soul.

Religion
Whilst adults are free to believe whatever brainless nonsense they wish, I think religious indoctrination of children is tantamount to mental abuse. Particularly the hell and eye-in-the-sky aspects.
Tablets
Whilst I think they're here to stay I see them as a somewhat disturbing trend away from a general purpose computer. Although they have some usefulness on the whole they are just throw-away devices used to deliver mindless entertainment to the unthinking masses.

The OLPC coming out with a tablet really put me off their whole project - a computer without a keyboard isn't useful enough for learning the skills needed for the future.

IT skills - including scripting and programming - is a huge competitive advantage to any industry that involves workers using a computer. Whichever country decides that this needs to be part of the core educational set (like it was when I was a kid, and not just learning a few arcane microsoft applications) will surely have a bright future.

Parallella/Epiphany
Well i'm basically waiting on the hardware before I get too excited on this one. Still don't have any particular application in mind but I'm hoping it's fun to code on for the entertainment value alone.
Patents/eye pee, etc.
This sort of extortion, commons-stealing, and rent-extraction is unforgivably a direct result of the corrupt political system we all have in the west. I don't currently see any solution to this problem whilst courts are involved.

It will just be an on-going cost of doing business which will be borne by the general public to the detriment of most and the benefit of very few.

The only hope is for China to ignore it all (as they are) and booming as a result (as they are), and the western countries starting to look at their own self interest instead of the interests of the pan-national rentiers to which they currently answer (hah, asif). Although the pan-nationals have their fingers in the pie over there too.

Given that the USA isn't far off a developing country as it is (run-down infrastructure, high infant mortanity rate etc) if they haven't already done something about it I don't see much chance for change. I just hope Australia's current obsession with the USA and it's demonstratively bad-ideas cools off a bit and keeps us from the same route.

Playstation 4
Who cares? Fuck Sony.
Work/Leave
Well i'm on my 8th week of leave and I gotta say i'm getting pretty comfortable with the idea. Pity it can't last forever ...

Saturday, 27 October 2012

64 core Parallela & ARM A9 Zynq

Well it looks like the Parallella endeavour did get funded after-all (just minutes ago). They only really got organised in the last 3 days so I really thought it was too late but they managed to get the word out and excitement up enough to make it.

Well done.

As I said previously, the 16-core chip is a teaser and the 64-core is where the action is ... So I was pleased they offered a guaranteed 64-core version once it was clear that the $3M target was a bit optimistic. So even I, the cynical old c**t that I am, got caught up a bit in it myself and went for the 64 core chip plus the early 16 core one, cases and a t-shirt. A bit of an indulgence but I can afford it.

I'm sure most people don't really understand what they're getting into (that's pretty much the modus operandi of Kickstarter), but a Zynq board for $100 is still good value apparently even without the floating-point accelerator tacked on.

Although they just made it now, it's still open for a few hours, so get over there and have a poke if you're interested in a fully documented open embeddable low-power platform - i.e. ALL of the components will be documented and include ALL the free software to access it, including the accelerator. (well, this is what is promised, i'm not sure how far it stretches to the ARM/Zynq, but I presume that is already covered elsewhere).

This is in stark contrast to other 'open' boards such as:

  • Raspberry PI - GPU is completely closed. The graphics driver is still just a big binary blob despite the simply fraudulent recent announcement that it was now 'fully open'. One wonders at the timing of that announcement.
  • Beagleboard & friends - GPU is completely closed. The DSP and most of the on-board hardware is well documented but the OS it runs and the compiler is proprietary (last i looked).
  • Allwinner A10 - GPU and VPU are both completely closed. Even if the lima driver ever gets there, it wont be thanks to the vendor.
  • Any other ARM SOC you care to think of: programmable GPU ALL closed, VPU ALL closed.

As the basic board comes with a 'Zynq' processor, which is a dual-core A9 plus a FPGA on chip, it opens up more than just parallel processing to 'the masses' to include reconfigurable hardware too. I don't know much about these but I have it on good authority that they are very cool chips and i'm looking forward to investigating that aspect as well - if i ever get the time to (the lack of free tools there might impede too).

Given this open nature i've been a bit bummed by some of the hostile reception it's received in some of the 'open hardware/software' forums and mailing lists. Come on fellas, the world is big enough for more players - no need to get so defensive. And given how much of a whinge they've all had about vendor documentation, GPL violations, tainting buggy binary driver blobs, and everything else the cool reception is more than a little baffling. If nothing else some competition has to help making progress with other vendors who have all closed ranks.

Scalar vs SIMD, not all FLOPS are equal

I think some just don't see what the big deal is - it's just a chip not a solution, so and so have a chip that does x flops too, blah has something coming that will blow it all away, or those total flops just aren't that much ...

The problem with marketing numbers is that they're just marketing numbers. Peak FLOPS are impossible to achieve with any cpu and any algorithm - but the main avenue for increasing the FLOP count for the last 20 years - SIMD - only makes this much harder to achieve.

GPU's only make this worse. They throw so much hardware at it you still get very good results - but they aren't efficient at many tasks, and difficult enough to programme for the ones they are.

I'm sure you'd have to be living under a rock to miss the fact that when the Playstation 3 came out, a lot of developers made a lot of noise about how difficult it was to programme for. If you put in the time - and you really had to resort to assembly language - you could get phenomenal through-put through the SPUs, but if you didn't, all you had were 6 fairly gutless cores which were on top of that - a bit tricky to use. And it used a lot of power to get there.

Although the Eiphany shares some of the trickiness of use that the SPU's do (including the cache-less local memory, although it's easier to access off-core memory), simply because it is scalar a higher flop utilisation rate should be achievable for normal code. Without having to resort to assembly language or even worse - intrinsics. Not to mention the power differential: 90 odd gflops for the 64-core version ... in 5w system power.

A floating point MUL only has a latency of 4 cyles too - rather than the 7 on the CELL or 6 (iirc) for NEON, which makes the compiler or assembly language writer's job of scheduling that bit easier as well. Although assembly is an absolute must for NEON, the instruction set it so simple and there are so many registers i'd be surprised if it was needed in practice for the epiphany core.

Another point about competitors - ziilabs thing looks awesome! An embedded chip with a programmable multi-core co-processor! Yay! Oh, I can't actually get a machine with one in it? Oh. It only runs Android - a cut down, appliance version of Linux? Boo. Even if you could get one the grid-cpu is proprietary and secret and only we're allowed to use it, and you must go through the framework we provide? Blah, who cares.

Nothing's perfect

Engineering is not mathematics or science. Mathematics is absolute. Science is knowing to within a known degree of knowing. Engineering is a constant compromise. The real world has a habit of getting in the way. Cost, time, knowledge, physics, they all conspire to prevent the attainment of mathematical perfection.

The human curse that we all bear is that if we ever actually got what we truly wished for, we'd just think of something else we wanted.

PS This list is just my take on a fairly quick reading of the architecture documents and instruction set, it may contain wildly inaccurate misreadings and other mistakes.

Software
Well they're opening everything up for a reason, the 4 (or 5?) man team just doesn't have the resources to fill out everything. It's cheap enough that there should be no real barriers to entry to poking around, and the more that poke the more that gets done for free. This will be an interesting test to see how a loose group fares against multinational corporations and commercial standards bodies in coming up with usable solutions.

So it might be a while before X is accelerated, if ever.

The thing that most gives me the willies is that the sdk is based on eclipse, but it uses gcc as the backend anyway.

Memory
The 16 core version only has 32K SDRAM per core and 512K total per chip. And that includes both instruction and data. This per-core amount is the same as the cache on most ARM chips and will be a bit tricky to deal with. However this isn't a hard limit, just the limit on what is cheapest to access. OpenCL kernels are usually a lot smaller than this though, and so you can certainly get real work done with it. Not being confined to the OpenCL programming model would also enable efficient implementation of streaming (which is another way to save memory use).

The low latency instructions means loops wont have to be unrolled so much to hide them, so it should be able to achieve a higher code density anyway (not to mention the 16-bit versions of every instruction).

No cache
Only local memory. Programmers do hate this ... but the benefits you get from not having one are worth it here. A lot less power and silicon on the hardware side, and even though it might be a bit tricker to write efficient code, you're not getting hit with weird an unexpected results either because some data size hit cache tag aliasing. It goes a bit further than that too - no need for hardware memory barriers either, a write or read is a write or read to or from the target memory, not some half-way house. No cache snooping required.

I thought this (LDS) was one of the coolest features of SPUs, and it's a must-have in OpenCL too.

Latency
As one goes further from your local cell, the latency of memory access goes up quite quickly because as far as I can tell, each lane only goes one over and it requires multiple hops. But application-accessible DMA can be used to hide this and since you'll use it with the small local memory size anyway, it kind of comes for free.

Memory protection, virtual memory
None at all whatsoever on the accelerator. This is another bullet point as to how it achieves such a high flops/watt ratio.

Hardware threads
None. Rather than hide latency using multiple threads, one uses DMA.

Synchronisation primitives
None none that I noticed beyond a test and set instruction. This is a bit of a bummer actually as this kind of stuff can be very cool and very fast - but unfortunately it is also a gigantic patent minefield so i'm not surprised none is included. I'm talking about mailbox queues and mark/release type instructions for non-blocking primitives.

Since a core can only talk to its neighbours, this is probably not so useful or important anyway now I think about it.

Wednesday, 23 May 2012

lalalala i can't hear you lalalala

I came across a pretty bizarre bit of information on some opencl forums yesterday and the more I think about it the more it explains quite a few things about how just strangely m$ evangelists and fanbois behave. It's not a new thought, but a timely reminder and it got me thinking further about it.

It was a question regarding some building options when using one of their developer products: presumably by someone who has a paid-for or otherwise valid license for this product. Yet this is what their response was:

BTW, I originally posted this under Microsoft‘s Visual Studio forum and had it modded off-topic and (re)moved: “Moved by DanielMoth Microsoft Employee 1 hour 38 minutes ago We do not support OpenCL questions in the Microsoft forums. (From:Parallel Computing in C++ and Native Code)“

Presumably this is only because OpenCL is not a m$ endorsed platform, but I think there is a bit more to it than just that. I think m$ are shit-scared that anyone in their protected information sphere might be made aware that there are practical alternatives to the products they push. Or worse - that anyone might actually be using them. One always notices that they don't seem to be aware that there is a whole world of developers who don't need their snot to get real work done - and might be more productive without it. Obviously this is intentional. Pretty much on-par with how the main-stream-media continually pushes a message controlled by the monied classes to ensure people behave as they want.

In my recent work with Android I had a co-worker join me on the project, but unfortunately he is a big-time m$ fanboi. He even has a m$ phone 7, uses bing as his only search engine - on IE (I mean, ... "really"?), has never rarely used anything but microsoft IDEs - since circa 1990, etc. The thing is, he was totally lost outside of that environment, and any failings of the android sdk or documentation (of which there are plenty) prompted comments on how wonderful c-hash and whatever-wpf-is-called-this-month is. Forgetting that all toolkits pretty much suck and are a huge pain to work out when starting from scratch. I spent ~3 years on c-hash bullshit because of this guy, so i know he's so full of shit when he claims otherwise - and call him out on it.

But what most surprised me is that he didn't get a google account to access the shop, nor did he download a SINGLE android tablet application to find out how they work, and what sort of user-interface features work well vs which ones don't. I don't think he even looked at the bundled ones when I wasn't driving the machine.

Why would one intentionally handi-cap your ability to do a good job? Strange ... and I don't think it was to intentionally make the result look bad - it was just too much of a culture shock for him to be outside of his protective bubble. This is why we wasted a few weeks on an aborted web front-end in the first place as well.

Anyway, I think this childish insular attitude helps to explain much of the weirdness with m$ phone and nokia's scandalous fall from the market driven by a CEO of this mould. I've been reading a lot of Tomi Ahonen's blog of late, and some of the information about m$ phone shows they are being so insular in their rejection of all possible alternatives that it is causing them to make many mistakes and create a shit product that nobody wants.

BTW the fact that Tomi had high PR reps from Nokia trying to disparage him on twatter and even on his blog shows they have totally lost the plot. Totally insane.

Friday, 11 May 2012

The World Wide Web

So M$ are up to their old tricks again and restricting competitors from accessing their operating systems properly. Nothing ever changes apart from the date. Does it really matter much anyway? (who in their right mind is even going to use that shit to start with?). Mozilla are still pushing their it's-really-an-operating-system angle, but is that really ideal for me as a customer? Or even as a developer for that matter. One only has to look at any application on a tablet and compare it to it's browser counterpart. Even running on a monster desktop workstation the tablet usually beats the pants of it. e.g. google maps or youtube. For all it's "lowly" specifications (well, they aren't really), the tablet i've been using shits all over anything i've ever seen in a web browser, HTML5, or Flash, on much much faster machines. I would really like to see browsers eschew all that heavy-client crap which has turned them into bloated power wasters, and return to a world of delivering information in an open and linked way. This is something they actually do quite well, and then they can leave the heavier stuff to native applications which always do a better job. And with the range of devices exploding - from workstations to tv's to pocket computers - doing anything more than text with a few pictures, the odd form, is only going to become more difficult. The right tool for the right job, and all that.

Sunday, 15 April 2012

The Android

Well I've become a member of the 'exclusive' club of owners of android tablets, although I only got one for work.

The story so far ...

I finally got hold of the ipad the project manager had assigned to the project, and to cut a long story short: I missed a meeting because I was on leave, bad decisions were made that I didn't have enough background to question, things need to be decided. Getting a mac/learning objective C is really out of the question (for political, personal, and time reasons), so the only other option is android.

Even though I don't really see the point of them I just went out and got one from a local retailer because we don't have the time to muck around and I realised I needed to get more familiar with one. I grabbed a keyboard-less asus transformer prime - there just weren't that many options available and I didn't see the point in saving a couple hundred $ for the sake of an unknown (I wont state the price because we get totally shafted on electronics like this in Australia, but suffice to say it wasn't much more than a single day's net pay, so who cares really).

The prime

So the device itself seems fairly solidly put together, quite thin (thinnest apparently), a bit heavier than i'd like, and I can feel the smooth aluminium back easily slipping from ones hand: but a slick hardware package. The edges do have a slightly harsh finish, but it's not going to cut your hand either.

But the charger and connecting cable is probably the cheapest bit of electronics i've ever seen. Real trash that feels like it'll fall out or break at any time.

I don't like the power button - it's hard to know if you've pressed it, and I find I have to use a finger-nail to make sure, and it waits just that few 100ms too long to activate: where you're starting to doubt you've pressed it at all. Being on the bottom of a curving surface also just makes it hard to get to when you're holding it from the front.

So as I said it's a bit heavier than i'd like - it makes it a bit awkward to hold. Although one can certainly hold it in one hand in the air, it would give you a sore wrist.

The Market

Or google-play or wtf it's called this week. Pretty underwhelmed so far. Ok it's great saying you have 100K 'apps', but if they're mostly shit and the good ones impossible to find amongst all the chaff then what's the point. Most of the free ones seem to be advertising supported (advertising on software you're using? wtf? just not something i'm used to outside of a browser - and i barely see that anymore). Which means you have to sell your soul to download them: access to identity, access to your exact location, access to phone owner and state, etc etc. Another big class of applications are tons of 'my first android app' experiments which should be hidden away in a 'beta corner' or something and not clutter the general application lists.

It's like the bad old days of early 90s shareware all over again: hobbyist programmers thinking they can make a buck writing shit software full of utterly foetid secret-sauce. A few do, but the rest are wasting their own and everyone else's time. Having got used to Free Software I kind of forgot about all that although it's still around in the windows/mac worlds. Free software is quite different: the better stuff is driven by professional programmers solving problems usually orthogonal to their main job, and then sharing the maintenance burden and reducing the cost to everyone by publishing it freely.

I've only downloaded (and removed half of them) less than a dozen 'apps', but already i've had plenty of crashes doing simple things.

I'm sure as I find the gems (which I don't really want to have to spend the time doing) my opinion will lift, depending on the SNR (it could just as easily decline). e.g. I eventually found a free DLNA frontend that at least is written by a professional outfit (proprietary alas), before I realised it has one bundled (although that only plays the os supported formats). Pity mythtv is being cranky and it didn't work too well.

They might also be outside of the store - e.g. mupdf is by far and away way better than the pdf viewers bundled - who both take ages to render a page, and also render in 3 stages of blurriness (which is very very unpleasant to read), although that also seems to do the blurry thing when you pan around. And it doesn't ask for ANY permissions.

So, I will probably just have to write my own stuff again ...

Media

Video playback in the bundled player is pretty decent: but it has very limited format support. The other (free) players range from crap to awful, and even though most are obviously based on ffmpeg none of the authors seem to understand the license. I spent a bit of time trying to get internet radio working (my isp mirrors a large number of stations with no bandwidth charges) until after I succeeded I realised I would never listen to music this way - I have a beagleboard plugged into my hi-fi receiver and don't need to wear headphones to listen to whatever crap music I want at whatever volume I want in my own house! Might be handy to write a remote control for it though, although 'ssh' works pretty good so far.

Interface

Well it's snappy and flashy. The 'home screen' just seems pointless, but then again an alphabetically sorted list of all applications (with cut-down text) isn't much chop either. I'd rather Amiga's Workbench (with a few tweaks).

The Browser

The android browser is ok enough, but without being able to block adds pages are filled with animated stuff which distracts annoyingly and quickly drains the battery. The only option is to disable javascript but that is a web killer.

Firefox is a bit poor. Once rendered it's kind of ok, but otherwise it's slow and clunky to use. Why they waste a good chunk of screen down the side when you're in landscape mode is anyone's guess. Still needs work. I'd hate to see it on a 'lesser' tablet.

Even on this machine, using a browser is pretty damn clunky anyway. My browsing often consists of running searches, and typing on that on-screen keyboard just sucks. It might be ok if you're coming from a two-finger typing background but i've been using a keyboard for over 20 years and could touch-type over 15 years ago - it will never catch up. Reading long articles just doesn't feel that comfortable for some reason: I really wish we could override the bright white backgrounds, and it's a bit annoying having to drag/zoom every page to fit the readable area or to find navigation links.

And not being able to hide the animated advertising whilst trying to read an article on the net is pretty much a deal-breaker for me. I would rather use a laptop (even with it plugged in - required as the battery is long dead).

I tried the voice search a couple of times, but my accent throws it out. And try saying 'waikerie' and getting anything remotely close. The closest I got in a google maps search was some utterly unknown spot in the middle of New South Wales when I tried 'waikerie south australia'.

Flash actually works quite well - ABC's iview can only be accessed via flash, and it runs better than the flash on the ps3 and is a hell of a lot easier to use (joysticks suck as a mouse). On the other hand, it's nothing compared to the youtube app.

Coder's crouch

I've already got enough of a hunch-back from looking down at laptop screens for half of the day. And now one has to go another 60 degrees all the way down to flat? Either that or get a sore arm from holding the screen up at an acceptable angle.

For watching passive content it's a bit of a hassle as you need to hold it upright somehow, and for interacting you either need to lean over it or use two hands sometimes awkwardly.

I'm already thinking of making a stand for it ...

The rest

Given all the popular press I seem to see about them, I was actually surprised the lack of options in all the retailers (I just went to the city) - almost all had ithingys but most only had 1-2 models of 1-2 makes of tablet. They all had many more laptops. Which suggests to me that these things aren't really selling that well.

And what the fuck is this crap that ASUS thinks they can get away with people giving up their rights to a warranty on hardware just because you get a root login? What next - if we charge you $50 less you lose your warranty? Somehow I don't think either would mesh with the statutory warranty required from the retailer. I'm afraid I didn't research this as closely as I should have, but what can you do eh? I have the tool downloaded but I haven't used it, although eventually it will be running linux in some form or another.

So anyway in conclusion: all the arguments I had for myself against tablets still hold, and i'm not sure exactly what problem they're solving. Perhaps if you're sitting in a meeting looking down at agenda notes they are an effective paper replacement. But for reading a web page or a book - not terribly great. For watching video (when you have a 46" tv?) ok, but you have to prop it up somehow. For games? I have a ps3 and a touch screen is a pretty shitful interface compared to a controller (and for that matter, I haven't played any games there in months). Tilt isn't much better.

And modern casual games are an embarrassment to our civilisation. Games are for learning useful life skills. Things like chess are about strategy. Learning to click a coloured box for a virtual reward is not learning, it's a mental deficiency.

I think the smaller devices will have a better future. They have much more portability and the screen is big enough to be useful. And they are (or eventually will be) real pocket computers, not just small tvs.

So I guess now I have one, and i'll quite likely be coding on it for work (if not in the next few weeks, eventually), I guess I will do some free software on it too ... ahh more projects to distract me.

Thursday, 5 April 2012

The weekly ups and downs

So I noticed in the analytics graphs an obvious pattern emerge on my google code pages, which is probably due to the hit-rate getting high enough to rise above the noise (the point of which incidentally coincides with when I put up a test release of jjmpeg).

(the numbers have been truncated)

The pattern seems to have been there before, but now it's glaringly obvious. And that is that people are hitting the site only on during working days in the USA (there aren't enough hits yet to determine if there is a trend in the hours too).

So I wonder what that means; it is just working people looking for some free code? Students doing class-work? It seems to suggest that hobby programmers are probably not that interested in it; or that the vast majority only hack during the week-days (which i don't think likely, not to this extent). The only communications i've received have been from cost-free-code snarfers and students, so at least that data point correlates - although the sample is so small it doesn't amount to hard data.

Well whilst i'm on statistics of the site I'll dump a few other observations:

  • Rather modest numbers for a-hackers-craic: I broke 2K posts/month for the first time last month, and also broke 20K for its lifetime.
  • I always find it pretty funny how many people searching for an image of 'g-spot' end up loading the picture on one of my rant posts. It's a photo of an ibm keyboard. It's usually in the top-10 searches for the month!
  • Java FFT is still high on the search hit-rate.
  • Beagleboard/XBMC still gets plenty of hits even though I haven't worked on it or posted about it for over a year. The XBMC wrap-up post is usually in the top 10 for the month
  • Together the java fft and beagleboard xbmc wrap-up post are over 10% of all hits of the life-time of the blog.
  • More direct searches either for my name, the blog or the projects i have on google code. jjmpeg being fairly useful is an obvious reason, but also from more activity in various forums (e.g. opencl), and more consistently using my URL or google login for drive-by commenting elsewhere.
  • My google code projects are now my top referrers, although having a link off the Aparapi project added a good number of hits.
  • I get a lot of hits on rambling mind-dump posts which don't contain particularly useful information: like `opencl images and arrays', or 'sse gcc and amd'.
  • Quite a few people seem to be interested in 'kobo hacking'. But going by the lack of interest on the forums for anything other than a plugin to enable a few simple features, and no communications on my efforts, I would presume they're more interested in removing the advertising from the advertising-subsidised version, or cracking the drm.

Monday, 5 March 2012

Aparapi

So, I kept watching some more of the AMD fusion summit videos yesterday evening - and now I remember one reason I haven't watched them before: they take a long time to get through!

The GCN one was interesting (from 'Mike and Mike'), although the first Mike was a bit nervous and together with his Texan accent and rushing a bit, made him a bit hard to follow.

But the Aparapi one gave me some new respect for the project.

Although one thing I didn't think was correct was he kept going on about how Java programmers are completely braindead and don't know how to code for performance or deal with other issues (it's not like they're Python coders FFS):

Pointers?
Java coders have never seen a pointer eh? Object references behave the same because they are the same, and although you can't increment/index them, most coders stick to direct pointer dereferencing and array indexing anyway: i.e. exactly the same way they're used in Java. And they both have null pointer dereferences, it's just that Java's are non-fatal. So one could say Java programmers have never seen a fatal pointer access, but just because they're called object references or arrays, doesn't mean they're not pointers ...

Other languages?
Java programmers seem to love XML for some reason: they can cope with other languages. Look at ant: it's an XML form of bourne-shell! Not to mention Scala and so on.

Performance
Actually any of them already using Java for engineering/science know how to get performance: use objects of (single-dimensional) arrays, not arrays of objects. Write really ugly maths to cope with it. There's just no other practical choice without taking unacceptable performance hits.

And this goes for more fundamental understanding of the underlying architecture too. I know everyone likes to make out that abstraction means you don't have to know about registers and cache and how language constructs are executed by the hardware (and I know some schools of computer science try to hide such details), but that's bunkum. It affects every language because at the end of the day they're all executed as machine instructions.

Threading, barriers, etc.
Again for performance you can't avoid these. Java barriers are also the same semantically as OpenCL barriers and are a very simple concept if you're able to cope with the concept of concurrency at all.

Dynamic memory
Absolutely agree here, this is one thing Aparapi should hide.

So if a coder can't cope with these concepts already they are not going to be a potential user of Aparapi, so it seems strange to only target them as a potential adopter of the technology.

As with these concepts in Java, these 'braindead' coders will just use third party libraries and (ugh) frameworks to do this fiddly stuff for them, because even the simplest concurrency model that Aparapi presents (which is more like an OpenGL shader than a CL kernel) will be beyond them.

It's the actual concurrency which is the hard part: and for the most part OpenCL's concepts make the concurrency easier to deal with (or even, possible to deal with). So hiding the tools to deal with the concurrency whilst exposing the concurrency does seem a little counter-productive.

So I don't think hiding all the details of OpenCL is necessarily a good idea: sometimes one does need to know about data flow, local memory, 3-d workgroups, and barriers. 'system' and 'framework' programmers already need to know about threads and concurrency and so these related concepts will not be foreign to them. Although I noticed that Aparapi now has support for local memory blocks and so there's hope yet.

I'm not sure why Aparapi uses such an explicit memory transfer model either, when it could have managed the buffer memory in a simpler way. e.g. Java has accessors, why not use them to determine when buffer memory needs to be returned to the host? The data flow should be quite explicit from the kernel invocation order: no need to analyse the host code for this (and this is problematic: I don't see how the host code can invoke multiple kernels in a sequence from the example, since each kernel has its own single 'host' method - imho 'host' should be an attribute on any method rather than a single one, but maybe the api has moved on since then).

However, taking into account the future plans of the AMD/ARM platforms ... Aparapi has the potential to be much much more useful as the programming model could map quite well to the future target design. i.e. once one has zero-copy unified memory and a low-overhead job queue mechanism the cost of an Aparapi kernel call will become very low.

Although reviewing the plans, I suspect they're being a bit optimistic: i only recently discovered for example that async memory copies between CPU and GPU is only an 'preview' feature in the current sdk ... which was quite a 'WTF' moment - how seriously IBM-PC-XT is that ... OTOH moving the ringbuffer processing to the hardware removes most of the OS-specific code required to talk to the hardware and so will reduce the resource requirements for driver development (i.e. we wont have to wait for the driver devs, it'll already be done by the hardware guys).

I think the biggest problem for Java however is in the language itself, and in particular it's lack of mathematical expressivity[sic]. It doesn't support vector types for starters - which are handy in this case more for their ability to concisely realise mathematical expressions than the ability to map efficiently to SIMD processors. And even if one does wrap these in objects, using them is clumsy, error prone, and even messier if you're aiming for efficiency. e.g. it's simply cleaner writing C or OpenCL C code to perform most maths than it is doing the same in Java (in it's most purest object form, let alone optimised for practicality).

So although a lot of problems will probably map fine enough, occasionally one will be better off with lower-level access. If one could override the kernel code with your own string, but let Aparai handle the buffer management and let them all interoperate it would be very cool. Even if for example, it compiled the OpenCL code in to Java bytecode as the fallback (ok, this is a rather much bigger problem to solve ...).

Sunday, 4 March 2012

OpenCL

So i've been wondering just what opencl can be 'used for'. Apart from making an image editor or video tool run faster, I can't really think of what it might enable. As important as those tools are - and OpenCL does make some features possible now which were not before - the are very niche products of little direct benefit to most of us (unless all you do all day is sit on your arse consuming hollywood movies and glossy magazines, which is probably - utterly sadly - a majority or at least major minority).

Unfortunately when searching for 'opencl kill app' the first hit is my own post of the same title ... ahh well.

Anyway, along the way I found this this blog which has some interesting observations and ideas about OpenCL hacking.

For one I had missed that opencl 1.1 added a shuffle instruction: which is pretty much required for good performance for 'data streaming' applications: using SIMD to access non-aligned data. It can also be used to implement a vector index lookup. However, I'm not sure if this is a single-instruction function on GPU hardware, and it was just added to the spec for the CELL BE backend (without shuffle, the SPU's are kneecapped). Although it isn't too hard to find out by dumping the source code - which I did, and found that it isn't efficient at all. Oh well.

So back to the question of OpenCL applications: as from the last time I wrote about, enabling desktop performance on a hand-held computer is probably still the main thing we will all eventually see (although it's taking it's sweet time). This latest iteration of the thin client/server model (which harkens back to the original mainframe idea) wont necessarily last, as no previous iteration ever did. And although having an internet connectedness will be pervasive, you wont need to go to a back-end server to do the work when you have 100G/flops in your pocket.

The other thing, which I think is more interesting, is that OpenCL will enable cheaper design of complex systems - which means more competition and more products for the general public. So for example it has always been that even from the days of 8 bit computers you could design a hardware component to increase performance (sprite hardware, sound synth, etc), and this still allows advanced performance from portable or low-power devices. As OpenCL technology matures and die sizes continue to shrink, it will become feasible to replace the expensive custom silicon with more and more software, and so as we went from custom silicon to fpgas, we may well move toward more software-only solutions even in portable devices. OpenCL might be a prick to code in, but it's a lot easier than FPGAs are, and you can still get higher performance from purpose-built functional units (FPGA's big edge is in power requirements, and concurrency).

So I think OpenCL's killer application is not so much a consumer-facing one as a tool for system developers. Or at least, removing the need for system design input for a given application-specific device, and opening up similar facilities to all developers. This is pretty much the gist of one of the AMD talks from a couple of years ago (I think from the AMD developer summit, perhaps from 2010 as I can't see it in the 2011 talks - many of which look interesting enough to watch) about how they were able to produce results in less time and with fewer steps than going the hardware route. i.e. lower costs, higher payoffs, and so on. I.e. pretty much what FPGAs did for system design, OpenCL may do as well: it might not be as fast, but the reduced development costs and overheads for low-volume production, Moore's Law and so on more than make up for it.

As an aside, when I was playing around with the beagleboard I also looked up some arduino stuff from time to time. I thought it was amusing that so many 'old hands' would whine about how overpriced the arduino was and that you could get away with something simpler like a PIC and so on. It was amusing because we can all see where this is going with a computer such as the Raspberry PI coming out: these things are getting so cheap and ubuquitous, before too long those 'low cost' simple parts will only be made by niche manufacturers to service dying equipment: i.e. they will become too expensive for anything (not to mention the skills required). Before too long it wont be economically viable to use anything smaller than a 32-bit floating point cpu for anything requiring some calculations.

It's a pity that the whole patent issue is getting so ridiculously out of hand: now that we are on the verge of effectively commoditising the entire platform as it pertains to signal processing, we're all going to be thrown into a dark age of propping up the leeches and rentiers who seem to have captured governments the world over for their own benefit.

Update: So ... I did end up spending a couple of hours today watching some of the AMD fusion summit videos from 2011 (with a bit of a hangover i wasn't up for much more than this!). Quite interesting, I guess I should keep an eye out on this stuff a bit more, but when i'm busy with work or on leave I don't always keep up with it.

The first keynote was quite interesting (after the waffle from the first guy), the future direction of the 'HSA' (heterogeneous system architecture) platform. At one point there is a graphic showing a bunch of hardware driven queues where applications feed in job tasks directly from their process space and they are picked up and executed by the hardware directly ... without a cpu context switch or kernel-mode memory copy in sight.

Now THAT is interesting.

Although ... TBH what the diagramme most reminded me of was ... non-copying asynchronous message passing, and where have I seen that before? Oh ... AmigaDOS 1!? Well, it only took nearly 30 years to finally catch up ... sure there are differences in the capability, but given the technology of the time it's definitely the closest to the model proposed here. i.e. unified memory (CHIP ram!), separate processors working together, non-copying data flows, etc. It's more than just about the non-copying of data (although that is pretty important too), it's about keeping the ALUs fed with data, and avoiding the overheads of system interactions and exception/syscall processing (this is of course why AmigaOS worked in a similar way). Already with GPUs keeping them fed with data is basically impossible - they spend a lot of time waiting around twiddling their thumbs.

Still, it's funny how nice hardware design is when intel aren't involved ...

Speaking of not-intel, the talk from the ARM guy also was quite interesting. From their perspective the push for non-heterogeneous compute is not just about getting the job done faster, it's about getting it faster whilst using less power. With the process shrink there isn't enough power/heat sink to run all the transistors at once, so you have to divvy up the work in a way which gets it done the fastest without wasting the silicon, the power, and so on. And on a mobile device it's about trying to utilise all the extra gates are your disposal to keep pushing the edge of performance; whilst still keeping within heat and power budget. This obviously fits directly in with AMD's software stuff: how to actually programme such a chip in a practical way.

Although to me what is most interesting about this approach is that it acknowledges that there really is a hard physical limit on the amount of work a single silicon chip can do. And even though they're making them smaller and can fit more transistors they can't turn the new ones on at the same time. I had seen this in the OMAP processors but I thought that was just about power saving: not burning out the chips. Thus the only way to improve performance and utilise the extra silicon further is not by increasing the concurrency but by increasing the specialisation of the functional units, and having more of them. This is quite a fundamental change to hardware design: where normally one tries to maximise resource utilisation. (and yes, it contradicts my speculation above to some extent: but I wrote that before seeing the talk)

And it has pretty far reaching implications for software development too. And particularly for free software; if the specific functional units aren't available to everyone or use proprietary instruction sets or firmware.

I'm not sure i'm convinced of the whole cache coherency model though: I thought the CELL BE was a better idea for high performance since each CPU had it's own dedicated simple memory that runs fast (=== LDS), and knowing you have no cache coherency just means you code differently (and avoid a few pitfalls along the way). The main benefit you get is much higher effective bandwidth: if it has to go through a global cache you're still hitting a bottleneck. Still, it's all about the system performance not just the fpu, and also being able to practically achieve a good fraction of its theoretical peak in a reasonable time with a decent programmer: and these are system issues beyond the raw numbers and queue mathematics.

Well off to the GCN video: although from the last AMD roadmap there is a NEW GPU architecture headed our way by the end of the year, so I'm not so sure what's going on with GCN.

Friday, 1 July 2011

OpenCL killer application?

So i've been trying to think of some killer application that OpenCL could enable.

Sure you have video rendering or processing, signal analysis and the like - but for desktop use these sorts of things can already be done. And if it's a little slow you can always throw more cores and/or boxes at it.

But I guess the big thing is hand-held devices. This is probably why the ARM guys are starting to make noise of late: being able to put `desktop power' into hand-held devices. Still, this is more of an evolutionary change than a revolutionary one - with mobile phones now being pocket computers we all expect that one day they'll be able to do everything we can on bigger machines, with moores law and all that (which is related to the number of transistors, not the processing performance).

I was also thinking again about AMD's next-gen designs - one aspect I hadn't fully appreciated is that they can scale up as well as down. Even just a single SM unit with 4x16 SIMD cores running at a modest and battery-friendly clock rate would add a mammoth amount of processing power to a hand-held device. It has some similar traits to the goals behind the CELL CPU - the design forces you to partition your work into chunks that fit on a single SPU. But once done you get that done - you gain a massive benefit of then being able to scale up the software by (almost) transparently executing these discrete units of work on more processors if they're available.

So, I don't think there will be a 'killer application' - software that only becomes possible and popular because of OpenCL (for one, the platform support is going to be weak until the hardware is common, and even then micro$oft wont support it because they're wanker khunts) - rather it will be the hardware application of placing desktop-power into your hand (and if such performance is only utilised to play flash games at high resolution, I fear the future of humanity is already lost).

It's funny 'cause it's true ...

From a little while ago, but I just flipped threw a few weeks worth of xkcd the other day and came across it.


When I was doing engineering at uni we talked about the reams of documentation and being able to pre-define the problem to such a degree that the coding itself would be an afterthought. A mere bullet-point to be performed by lowly trained knuckle dragging code monkeys somewhere between finalising the design and testing. Of course, this was proven to be immediately impractical during our final year project - and that was about the last time I ever saw an SDD. In one job I had we started with lofty goals of fully documenting it using references SRS and SDD's and the like but in the end we just ended up with piles of junk. They were complete, and even sometimes up to date but ultimately useless - they didn't add any value.

In reality of course there are many impediments to such an approach:
  1. The customer doesn't know what they ultimately want. Ever.
  2. New ideas come along which change or add requirements.
  3. You don't know the best way to solve a problem without trying it.
  4. You don't know where to even start solving problems without plenty of experience.
  5. The market or other outside circumstances force a change.
  6. That just isn't how the brain works - you continue to learn every second of every day and that changes how you would solve problems or present them.
  7. It's slow and too expensive for anyone who has to earn money and not just ask for it (i.e. outside of defence, govt).
Although contracts are still written this way, and documentation is still a phone-book sized deliverable in military software. And computer engineering academia are still trying to turn what is essentially an art, into a science. I don't think their efforts are completely worthless (at least not all of them), but I think software is too complex for this at this stage and only getting more complex.

It's not that development documentation isn't useful - I wouldn't mind a good SRS myself - but there needs to be a happy medium.

Back to the flow-chart - which to me has a deeper meta-meaning even by being a flow-chart. The software engineering lecturers scoffed at flow-charts as being obsolete and out of date - yet they seem to be more useful than anything they claimed replaced it.

Personally I try to do it right but sometimes do it fast - because ultimately you always end up having to refresh a significant chunk of the code-base when the customer reveals what they really wanted from the start. Fortunately when i'm in the groove (say 30% of the time?) I can hack so fast and well (not to put tickets on myself, but i can) the line is a bit blurred - writing and (re)-re-factoring gobs of code on the fly as the design almost anneals itself into a workable solution. Pity I can't do that all the time.

Extra effort is usually is worth it, but not always. And sometimes the knack is just knowing when you get get away with taking short-cuts. For isolated code at the tail-end of the call-graph it usually makes little difference so long as it works.

If you throw the front-end away and start from scratch and you have some well designed code underneath, you can usually re-use most of it. Crappy code is much harder to re-use. But in the earlier stages of a project doing it right can be more of a hindrance. Particularly with OO languages - which force you to create good data models to fit the problem - which means even a small change to the problem can be a big change to the data model. Of course, many coders never achieve good data models, so perhaps for them the cost isn't so high - at the cost of perpetually low quality code. Yes I say data, not code - the data is always more important.

Annealing is probably a good way to describe software design and maturity process - early stages punctuated by large fluid changes due to high-energy experimentation then and over time the changes becoming smaller as it matures and solidifies. If the requirements change you have to put it back into the fire to liquefy the structure and reconsider how it fits in the new solution.

Simply bolting on new bits will only create an ugly and brittle solution.

Friday, 23 April 2010

Another week down

Blah. Been a long week - got a bit caught up with hacking away so had some pretty late nights, and then early mornings from phone calls or visitors. Hmm.

Some friends are in town from OS next week so that should be nice, hopefully I catch up with them and their new twins. I'd been trying to call for the last few weeks - after not having seen them for about a year - and finally got through at some silly time on Saturday morning. We also tried the PS3 video phone application (alas, i upgraded my firmware in the end ...) which wasn't too bad - a bit like those old 'hello from space' videos, but a bit clearer and sometimes the framerate was very good. Audio delay was noticeable though. First time i'e used a video phone, and it's a bit weird talking to someone through a window in another lounge room (maybe all the stranger stranger for it being 8am in the morning after being up all night). Didn't know where to look.

We've just had some great weather and it's a pity it looks like they'll arrive on ANZAC day - which is typically the obvious start to winter, and it looks like this this year will be a typical year. After hibernating for a Chicago winter i'm sure the week of 25+ we just had would've been nice.

On the international traveller front it sounds like my sister has had enough of the ignorance and absurdity of the country, and sick of not being able to get decent work and is heading back from America fairly soon. She's only been away for a few years but she might get a bit of a shock to see how far down that path we have also gone. Even if she doesn't decide to stay long, I'm hoping she cleans up my 'other house' that's sat empty for a couple of years collecting dust anyway!

Speaking of ANZAC day - that's a pretty good example of how the nation has become a bit feral. How a total rout and a day meant to remember the utter stupidity of war got turned into a day of nationhood and the glorification of `fighting for ones country' i'll never know. I always thought it was about remembering the poor diggers who were mis-used as pawns in political games or by incompetent chains of command, and the 'least we forget' was about the stupidity of sending them in the first place, not the 'honour of their sacrifice' - typical right wing bullshit. Now it all seems to be about draping yourself in the flag (a flagrant violation of the honour of any nation's flag - and they didn't even fight under that flag anyway - it was all as British subjects) in a sort of quasi-national day and thinking of it as the day 'we grew up' - I can't really say if it was, but we surely have 'grown down' since if this is the thought of the common man these days.

Sunday, 21 March 2010

A couple of links, the wall of dread lurches forward, dried meat.

A couple of interesting posts I came across this evening:
  • Obliquity by John Kay, an old article from the Financial Times, via Naked Capitalism.

    Showing examples of how direct goals such as 'increasing shareholder value' are the least successful way to achieve it. Food for thought in this crazy modern world where CEO bonuses and shareholder returns are the the sole quantification of success of a company or industry. Interesting in light of globalisation, out-sourcing, patenting of everything from ideas to seeds to animals, and so on and so forth that all put private profit before society.

  • Curtain of Tragedy Will Be Raised Soon Enough, But Perhaps Not Next in Japan, Jesse's CafĂ© AmĂ©ricain.

    A pretty depressing look into the crystal ball for the next decade or so. I don't think Australia for one realises how fragile it's current `resource-driven' aka `lucky-country' or rather, `stupid-country' economy really is (as opposed to 'the clever country' era which gave the me the opportunity to go through Uni). A little god-bothery at the end, but don't let that put you off, Jesse always has lots of interesting things to say.

  • More than a four-letter word from Financial Armageddon, and Revolution, flashmobs, and brain chips. A grim vision of the future from The Guardian.

    Both about a new report from the UK Department of Defence about the world-wide strategic threat environment in 30 years time. As The Guardian's sub-heading says, very grim reading. It's all about the population really; I can't imagine any palatable political solution, and any trend line with no limit has no scientific solution either. In for a bumpy ride even if these glimpses of the future are out by a few years. Although at my age I may just escape it through natural means.

All very depressing. I don't think it helped that I was sort-of watching a pretty grim tv series 'The Survivors' at the same time either. Although I don't think the writers there can do maths terribly well - a 90% reduction in population would still leave a sizeable number of people in Britain - over 5 million. Not one dozen, and even raw meat takes more than a few hours to go off on the nose in a disconnected fridge! Hmm all this reminds me for some reason about a book I read a few years ago called `The Genocides' that left me deeply disturbed for at least a week. It just a sadistic device of the author simply give the reader un unpleasant time and lasting memory. It is a grotesque tale with no redeeming features whatsoever. Avoid.

Wall of Dread

Well, on to more mundane and thankfully lighter topics. This afternoon I finally got off my fat bum and spent 4-5 hours working on the main retaining wall. Managed to finish the bottom layer and stacked another two on top since I was on a run - I still need some ag-pipe before I can back-fill each layer with gravel, so I should try to get that early this week so I can get most of the work just out of the way at last. I was going to walk it from the plumbing shop - it's only about 1km away. Although I may have stuffed up a bit - i'm not sure where the ag-pipe should drain to, and I didn't leave any drainage holes along the 12m of the run. It can still come out of the ends though, so maybe i'll just do that (unlikely i'll move all those damn blocks again, particularly the bottom row). I also re-cut the stair-case base to make the steps deeper, although I can't fill that in till I have that ag-pipe.

I measured the height along the length once I finished it rises a bit in the middle unfortunately - about 8mm, but at least in a relatively smooth curve. Yes yes, stupid I know - I should have regularly measured, but I did have another string-line at the brick level and used a couple of spirit levels, but all those little `close enough fuckit's add up. But it doesn't really matter because it only goes out `significantly' where the stair-case is, which is a natural break in the line. I guess i'll have to see how much it settles over time too. My $5 rubber mallet disintegrated before the last few base bricks were done, but I managed to tap down and level the last few with a bit of wood and a heavy ball-peen hammer - pretty well over it all by that stage, but I think I didn't drop off too much in finishing quality. Knowing my luck it will be a bit out compared to the boundary (and to-be-shed-wall), but that should only affect the aesthetics unless I made a really big mistake.

Dried Beef

The biltong turned out more or less ok. I've been sampling bits as I went along to see how it 'aged', and the first bits were a bit young (they were also thinner). The flavour didn't really settle till today, 6 days in - once the vinegar had dissipated. I made a slight variation for two sets of strips. One I rinsed in water and vinegar to remove the excess salt, as according to one recipe, and the other I left as is in an attempt to keep more flavour in-tact, according to another. The vinegar one ended up pretty bland, so i'm not sure that's the right idea. But the other one is a bit salty - ok with a beer in hand or after a long hot day in the sun, but not fantastic. Since I was caught up with some other things I also salted it for about 15 hours, so maybe next time I'll just try a shorter seasoning session. Although I imagine most of the salt would still be clinging to the outside once it is hung up. Need a way to get more chilli flavour on it too - maybe some sambal pedas as a final stage. Still, one bit I tried today I'd label a success, even with the saltiness. Almost has a touch of salami flavour to it, mixed with bbq steak, a bit more chilli and less salt and it could be a winner. 1kg of well-trimmed lean porterhouse made about 400g of biltong; so it's pretty cheap to make. Will have to investigate a better drying cabinet than a house-moving box with a shade-cloth cover though, at least if it becomes a regular task.