Category Archives: professional

Programming NVIDIA GPUs and Intel MIC with directives: OpenACC vs OpenMP

Last month I was at Intel’s software conference learning about Many Integrated Core (MIC), the company’s forthcoming accelerator card for HPC (High Performance Computing). This month I am in San Jose for NVIDIA’s GPU Technology Conference learning about the latest development in NVIDIA’s platform for accelerated massively parallel computing using GPU cards and the CUDA architecture. The approaches taken by NVIDIA and Intel have much in common – focus on power efficiency, many cores, accelerator boards with independent memory space controlled by the CPU – but also major differences. Intel’s boards have familiar x86 processors, whereas NVIDIA’s have GPUs which require developer to learn CUDA C or an equivalent such as OpenCL.

In order to simplify this, NVIDIA and partners Cray, CAPS and PGI announced OpenACC last year, a set of directives which when added to C/C++ code instruct the compiler to run code parallelised on the GPU, or potentially on other accelerators such as Intel MIC. The OpenACC folk have stated from the outset their hope and intention that OpenACC will converge with OpenMP, an existing standard for directives enabling shared memory parallelisation. OpenMP is not suitable for accelerators since these have their own memory space.

One thing that puzzled me though: Intel clearly stated at last month’s event that it would support OpenMP (not OpenACC) on MIC, due to go into production at the end of this year or early next. How can this be?

I took the opportunity here at NVIDIA’s conference to ask Duncan Poole, who is NVIDIA’s Senior Manager for High Performance Computing and also the President of OpenACC, about what is happening with these two standards. How can Intel implement OpenMP on MIC, if it is not suitable for accelerators?

“I think OpenMP in the form that’s being discussed inside of the sub-committee is suitable. There’s some debate about some of the specific features that continues. Also, in the OpenMP committee they’re trying to address the concerns of TI and IBM so it’s a broader discussion than just the Intel architecture. So OpenMP will be useful on this class of processor. What we needed to do is not wait for it. That standard, if we’re lucky it will be draft at the end of this year, and maybe a year later will be ratified. We want to unify this developer base now,” Poole told me.

How similar will this adapted OpenMP be to what OpenACC is now?

“It’s got the potential to be quite close. The guy that drafted OpenACC is the head of that sub-committee. There’ll probably be changes in keywords, but there’s also some things being proposed now that were not conceived of. So there’s good debate going on, and I expect that we’ll benefit from it.

“Some of the features for example that are shared by Kepler and MIC with respect to nested parallelism are very useful. Nested parallelism did not exist at the time that we started this work. So there’ll be an evolution that will happen and probably a logical convergence over time.

If OpenMP is not set to support acclerators until two years hence, what can Intel be doing with it?

“It will be a vendor implementation of a pre-release standard. Something like that,” said Poole, emphasising that he cannot speak for Intel. “To be complementary to Intel, they have some good ideas and it’s a good debate right now.”

Incidentally, I also asked Intel about OpenACC last month, and was told that the company has no plans to implement it on its compilers. OpenMP is the standard it supports.

The topic is significant, in that if a standard set of directives is supported across both Intel and NVIDIA’s HPC platforms, developers can easily port code from one to the other. You can do this today with OpenCL, but converting an application to use OpenCL to enhance performance is a great deal more effort than adding directives.

NVIDIA Nsight comes to Eclipse for Mac, Linux GPU programming

NVIDIA has ported its Nsight development tools, previously a plug-in for Visual Studio, to run within the open source Eclipse IDE for use on Mac and Linux.

image

The Nsight tools include profiling, refactoring, syntax highlighting and auto-completion, as well as a bunch of code samples.

The Windows version for Visual Studio has also been updated, and now supports local GPU debugging as well as new support for DirectX frame debugging and analysis.

Although Eclipse of course runs on Windows, Nsight users should continue to use the Visual Studio version. NVIDIA is not supporting use of the Eclipse Nsight on Windows.

The tools are in preview and you can sign up to try them here.

Another significant development is the availability of the CUDA LLVM Compiler. NVIDIA has contributed CUDA compiler code to the open source LLVM project. This means that other languages which compile to LLVM intermediate assembly language can be adapted to support parallel processing on NVIDIA GPUs. The CUDA Compiler SDK will be made available this week at the NVIDIA GPU Technology Conference in San Jose.

System Center 2012, Windows 8 and the BYOD revolution

Yesterday I attended a UK Microsoft MMS catch-up session in Manchester, aimed at those who could not make it to Las Vegas last month. The subject was the new System Center 2012, and how it fits with Microsoft’s concept of the private cloud, and its strategy for supporting Bring Your Own Device (BYOD), the proliferation of mobile devices on which users now expect to be able to receive work email and do other work.

The session, I have to say, was on the dry side; but taken on its own terms System Center 2012 looks good. I was particularly interested in how Microsoft defines “private cloud” versus just a bunch of virtual machines (JBVM?). Attendees where told that a private cloud has four characteristics:

  • Pooled resources: an enterprise cloud, not dedicated servers for each department.
  • Self service: users (who might also be admins) can get new server resources on demand.
  • Elasticity: apps that scale on demand.
  • Usage based: could be charge-back, but more often show-back, the ability to report on what resources each user is consuming.

Microsoft’s virtualization platform is based on Hyper-V, which we were assured now represents 28% of new server virtual machines, but System Center has some support for VMWare and Citrix Xen as well.

System Center now consists of eight major components:

  • Virtual Machine Manager: manage your private cloud
  • Configuration Manager (SCCM): deploy client applications, manage your mobile devices
  • Operations Manager: monitor network and application health
  • Data Protection Manager: backup, not much mentioned
  • Service Manager: Help desk and change management, not much mentioned
  • Orchestrator: a newish product acquired from Opalis in 2009, automates tasks and is critical for self-service
  • App Controller: manage applications on your cloud
  • Endpoint protection: anti-malware, praised occasionally but not really presented yesterday

I will not bore you by going through this blow by blow, but I do have some observations.

First, in a Microsoft-platform world System Center makes a lot of sense for large organisations who do not want public cloud and who want to move to the next stage in managing their servers and clients without radically changing their approach.

Following on from that, System Center meets some of the requirements Microsoft laid out as the start of the session, but not all. In particular, it is weak on elasticity. Microsoft needs something like Amazon’s Elastic Beanstalk which lets you deploy an application, set a minimum and maximum instance count, and have the platform handle the mechanics of load balancing and scaling up and down on demand. You can do it on System Center, we were told, if you can write a bunch of scripts to make it work. At some future point Orchestrator will get auto scale-out functionality.

Second, it seems to me unfortunate that Microsoft has two approaches to cloud management, one in System Center for private cloud, and one in Azure for public cloud. You would expect some differences, of course; but looking at the deployment process for applications on System Center App Controller it seems to be a different model from what you use for Azure.

Third, System Center 2012 has features to support BYOD and enterprise app stores, and my guess is that this is the way forward. Mobile device management in Configuration Manager uses a Configuration Manager Client installed on the device, or where that is not possible, exploits the support for Exchange ActiveSync policies found in many current smartphones, including features like Approved Application List, Require Device Encryption, and remote wipe after a specified number of wrong passwords entered.

The Software Center in Configuration Manager lets users request and install applications using a variety of different mechanisms under the covers, from Windows Installer to scripts and virtualised applications.

Where this gets even more interesting is in the next version of InTune, the cloud-based PC and device management tool. We saw a demonstration of a custon iOS app installed via self-service from InTune onto an iPhone. I presume this feature will also come to Software Center in SCCM though it is not there yet as far as I aware.

You can also see this demonstrated in the second MMS keynote here – it is the last demo in the Day 2 keynote.

image

InTune differs from System Center in that it is not based on Windows domains, though you can apply a limited set of policies. In some respects it is similar to the new self-service portal which Microsoft is bringing out for deploying Metro apps to Windows RT (Windows on ARM) devices, as described here.

This set me thinking. Which machines will be easier to manage in the enterprise, the Windows boxes with their group policy and patch management and complex application installs? Or the BYOD-style devices, including Windows RT, with their secure operating systems, isolated applications, and easy self-service app install and removal?

The latter approach seems to me a better approach. Of course most corporate apps do not work that way yet, though app virtualisation and desktop virtualisation helps, but it seems to me that this is the right direction for corporate IT.

The implication is two-fold. One is that basing your client device strategy around iPads makes considerable sense. This, I imagine, is what Microsoft fears.

The other implication is that Windows RT (which includes Office) plus Metro apps is close to the perfect corporate client. Microsoft VP Steven Sinofsky no doubt gets this, which is why he is driving Metro in Windows 8 despite the fact that the Windows community largely wants Windows 7 + and not the hybrid Metro and desktop OS that we have in Windows 8.

Windows 8 on x86 will be less suitable, because it perpetuates the security issues in Windows 7, and because users will tend to spend their time in familiar Windows desktop applications which lack the security and isolation benefits of Metro apps, and which will be hard to use on a tablet without keyboard and mouse.

Convert .NET Intermediate Language to JavaScript

Whomever called JavaScript the assembly language of the web was a true prophet.

Compiling .Net code to JavaScript is not new. I have heard that Microsoft’s Office Web Apps, browser-hosted editing of Office documents, are built with Script#.

The difference with JSIL is that it compiles .NET Intermediate Language (IL), and therefore works with any .NET language – though note that:

JSIL is still in development. You will hit bugs

The screenshot says it all

image

Microsoft’s Visual Studio LightSwitch: does it have a future?

A recent and thorough piece on Visual Studio LightSwitch prompted a Twitter discussion on what kind of future the product has. Background:

  • LightSwitch is an application generator which builds data-driven applications.
  • A LightSwitch application uses ASP.NET on the server and Silverlight on the client.
  • LightSwitch applications can be deployed to Windows Azure
  • LightSwitch apps can either be browser-hosted or use Silverlight out of browser for the desktop
  • LightSwitch is model-driven so in principle it could generate other kinds of client, such as HTML5 or Windows 8 Metro.
  • LightSwitch first appeared last year, and has been updated for Visual Studio 11, now in beta.

I have looked at LightSwitch in some detail, including a hands-on where I built an application. I have mixed feelings about the product. It was wrongly marketed, as the kind of thing a non-professional could easily pick up to generate an application for their business. In my opinion it is too complex for most such people. The real market is professional developers looking for greater productivity. As a way of building a multi-tier application which does its best to enforce good design principles, LightSwitch is truly impressive; though I also found annoyances like skimpy documentation, and that some things which should have been easy turned out to be difficult. The visual database designer is excellent.

The question now: what kind of future does LightSwitch have? Conceptually, it is a great product and could evolve into something useful, but I question whether Microsoft will stick with it long enough. Here is what counts against it:

  • The decision to generate Silverlight applications now looks wrong. Microsoft is not going to do much more with Silverlight, and is more focused on HTML5 and JavaScript, or Windows Runtime for Metro-style apps in Windows 8 and some future Windows Phone. There is some family resemblance between Windows Runtime and Silverlight, but not necessarily enough to make porting easy.
  • There is no mobile support, not even for Windows Phone 7 which runs Silverlight.
  • I imagine sales have been dismal. The launch product was badly marketed and perplexing to many.

What about the case in favour? Silverlight enthusiast Michael Washington observes that the new Visual Studio 11 version of LightSwitch generates OData feeds on the server, rather than WCF RIA Services. OData is a REST-based service that is suitable for consumption by many different kinds of client. To prove his point, Washington has created demo mobile apps using HTML5 and JQuery – no Silverlight in sight.

image

Pic from here.

Washington also managed to extract this comment from Microsoft’s Steve Hoag on the future of LightSwitch, in an MSDN forum discussion:

LightSwitch is far from dead. Without revealing anything specific I can confirm that the following statements are true:

– There is a commitment for a long term life of this product, with other versions planned

– There is a commitment to explore creation of apps other than Silverlight, although nothing will be announced at this time

Hoag is the documentation lead for LightSwitch.

That said, Microsoft has been known to make such commitments before but later abandon them. Microsoft told me it was committed to cross-platform Silverlight, for example. And it was, for a bit, at least on Windows and Mac; but it is not now. Microsoft was committed to IronRuby and IronPython, once.

For those with even longer memories, I recall a discussion on CompuServe about Visual Basic for DOS. This was the last version of Microsoft Basic for DOS, a fine language in its way, and with a rather good character-based interface builder. Unfortunately it was buggy, and users were desperate for a bug-fix release. Into this discussion appeared a guy from Microsoft, who announced that he was responsible for the forthcoming update to Visual Basic for DOS and asked for the top requests.

Good news – except that there never was an update.

The truth is that with LightSwitch still in beta for Visual Studio 11, it is unlikely that any decision has been made about its future. My guess, and it is only that, is that the Visual Studio 11 version will be little used and that there will be no major update. If I am wrong and it is a big hit, then there will be an update. If I am right about its lack of uptake, but its backing within Microsoft is strong enough, then maybe in Visual Studio 12 or even sooner we will get a version that does it right, with output options for cross-platform HTML5 clients and for Windows Phone and Windows Metro. But do not hold your breath.

Microsoft re-imagining client computer management for Windows 8

I am surprised this post by Microsoft Program Manger Jeffrey Sutherland has not attracted more attention. It describes enterprise app deployment to Windows on ARM devices, now officially called Windows RT devices. These devices run Windows 8 compiled for ARM, which means high efficiency but a greater degree of lockdown than with x86. In particular, desktop applications cannot be installed, though Microsoft Office is pre-installed, but without Outlook.

The interesting aspect is that what Sutherland describes is not just a way of managing Windows RT computers, but a new approach which fits with the trend towards BYOD – Bring Your Own Device – where employees use their own devices for work as well as at home.

Quick reminder: in the old model, Windows clients are managed by being joined to a domain, controlled by Active Directory. Once domain-joined, the machine is subject to group policy administered by the domain, a fine-grained system for configuring settings and deploying applications.

Windows RT devices cannot be joined to a domain. However, there is a new option in Control Panel to “connect to your company network”.

image

Note that the user must still be joined to the Active Directory domain. Since this is now joining the machine to the network and subjecting it to a degree of centralised control, Windows RT network joining is conceptually not far distant from domain joining, but it is a completely new approach.

The next step is to install a management agent which communicates with the Enterprise network.

Once network-joined and with the agent installed, the machine:

  • Is subject to a set of security policies covering password and logon rules (eg whether to allow picture logons)
  • Is audited for antivirus and antispyware status, drive encryption and auto-update; network connection can be refused if not compliant
  • Will lock encrypted drives if wrong password is entered repeatedly
  • can automatically set up a VPN profile for network access
  • enables access to a self-service portal (SSP), operated by the enterprise, for app deployment
  • can be deactivated which renders all SSP-deployed apps inoperable

The SSP can deploy custom or third-party Metro apps, but can also include links to the Windows store and web links to web application.

Microsoft envisages the above tools being used both for company-owned and employee-owned Windows RT devices. One advantage over domain-joining is that it is less intrusive to the user. When you domain-join a Windows PC, it creates a new user profile on the machine, which can be a nuisance if the user wants to use the machine for non-work purposes; they have to either switch profiles or use the work profile for home as well.

Metro-style apps are inherently better suited for intermingling business and home, since they are isolated from one another and from the operating system.

This new approach is not only for Windows RT machines but works on x86 as well:

We do support this functionality on x86. However, x86 also has a load more management functionality through Domain membership, Group Policy and existing tools like System Center.

says Microsoft’s Iain McDonald in the comments.

Although it is true that the old domain-joined model offers a higher degree of control, Windows RT should have security advantages thanks to the lockdown preventing desktop applications from being installed, which will restrict malware.

Windows computer domains are not going away, but BYOD and the trend towards cloud computing will gradually reduce the number of domain-joined machines. For example, a small business using Small Business Server will usually domain-join all its machines, but a small business using Office 365 will usually not do so.

I should add that although the approach outlined above is great for simplicity and flexibility, the fatal flaw for many organisations will be its dependence on Metro-style apps. If you have any Windows desktop apps to deploy, then it will not work.

Microsoft results: old business model still humming, future a concern

Microsoft has published its latest financials. Here is my at-a-glance summary:

Quarter ending March 31st 2012 vs quarter ending March 31st 2011, $millions

Segment Revenue Change Profit Change
Client (Windows + Live) 4624 +177 2952 +160
Server and Tools 4572 +386 1738 +285
Online 707 +40 -479 +297
Business (Office) 5814 +485 3770 +457
Entertainment and devices 1616 -319 -229 -439

What is notable? Well, Windows 7 is still driving Enterprise sales, but more striking is the success of Microsoft’s server business. The company reports “double-digit” growth for SQL Server and more than 20% growth in System Center. This seems to be evidence that the company’s private cloud strategy is working; and from what I have seen of the forthcoming Server 8, I expect it to continue to work.

Losing $229m in entertainment and devices seems careless though the beleaguered Windows Phone must be in there too. Windows Phone is not mentioned in the press release.

Overall these are impressive figures for a company widely perceived as being overtaken by Apple, Google and Amazon in the things that matter for the future: mobile, internet and cloud.

At the same time, those “things that matter” are exactly the areas of weakness, which must be a concern.

A bug in embedded Internet Explorer in Windows 8

Long-time readers of this site may remember that I did some work on embedding Internet Explorer, and its core rendering component MSHTML, in .NET applications. The code is still online.

I noticed that it does not work properly in Windows 8 Consumer Preview. Specifically, plain HTML works but you can no longer apply external CSS stylesheets. I reported the bug here (sign-in required).  I did not use my own component, but rather the standard WebBrowser control. I have appended the code to reproduce the bug in case you cannot see the report.

Microsoft has now responded as follows:

We were able to validate your feedback. However, based on the limited impact this bug may have, we will not be able to address this bug during this release.

This status is also known as “won’t fix” and gives me pause for thought. How many other little bugs are there which Microsoft is not fixing, but which break a certain number of applications?

If you are one of those few people using embedded IE in an application, I suggest checking Windows 8 compatibility now to avoid any unpleasant surprises.

Perhaps it would be preferable to use WebKit or Gecko (Mozilla) rather than IE in any case. There is a thread on stackoverflow that discusses some options. OpenWebKitSharp looks promising.

Code to reproduce the bug:

Create a Windows Forms application in C# in VS 11. Add a Webbrowser control and two buttons, and an OpenFileDialog control. Also add a reference to the COM library Microsoft HTML Object Library.

Here is the code for the first button that loads some HTML:

string sHTML = "<html><head><title>Some title</title></head><body><p>Some text</p></body></html>";
this.webBrowser1.DocumentText = sHTML;

Here is the code for the second button that applies a stylesheet:

openFileDialog1.Filter = "CSS files|*.css";
if (openFileDialog1.ShowDialog() == DialogResult.OK)  {
mshtml.HTMLDocument doc = (mshtml.HTMLDocument)this.webBrowser1.Document.DomDocument;
doc.createStyleSheet(openFileDialog1.FileName);
}

This is the stylesheet I am applying:

body
{
    font-family: Arial;
    font-size: 18pt;
}

To reproduce, run the application. Click the first button to load the HTML. Then click the second button to apply the stylesheet. In Windows 7 and earlier the stylesheet is applied. In Windows 8, the stylesheet is not applied.

UPDATE: It seems this bug was fixed in Windows 8 RTM, despite the “will not fix” designation. Good.

Windows 8 to be called Windows 8, no Outlook on ARM

Microsoft has announced the range of editions planned for Windows 8, which is now the official name (previously it was a code name).

Here is what I found interesting. Windows on Arm (WOA) is now called Windows RT and ships with Office included. However, Outlook is not included, confirming my suspicion that Outlook may gradually get de-emphasised in favour of separate email, calendar and task managers built into the operating system but with strong Exchange support – a good move since Outlook is perhaps the most confusing and over-complex application that Microsoft ships.

Windows RT is missing some features which are in the Intel versions, not least the ability to install desktop software, but has an unique feature of its own: device encryption.

I consider Windows RT as critical to the success of the Windows 8 project, and the only edition that may compete effectively with the Apple iPad in terms of price, convenience, battery life and usability. That said, the market will see the Intel version as primary, since it is the one that can run all our existing apps, but all the legacy baggage will also weigh it down. Users will suffer the disjunction between Metro and Desktop, and will need mouse or stylus and keyboard to use desktop applications. The danger is that Windows RT will get lost in the noise.

Multicore processor wars: NVIDIA squares up to Intel

I first became aware of NVIDIA’s propaganda war against Intel at the 2012 GPU Technology conference in Beijing. CEO Jen-Hsun Huang stated that CPUs are remarkably inefficient for multicore processing:

The CPU is fast and is terrific at single-threaded performance, but because so much of the electronics inside the CPU is dedicated to out of order execution, branch prediction, speculative execution, all of the technology that has gone into sustaining instruction throughput and making the CPU faster at single-threaded applications, the electronics necessary to enable it to do that has grown tremendously. With four cores, in order to execute an operation, a floating point add or a floating point multiply, 50 times more energy is dedicated to the scheduling of that operation than the operation itself. If you look at the silicone of a CPU, the floating point unit is only a few percentage of the overall die, and it is consistent with the usage of the energy to sequence, to schedule the instructions running complicated programs.

That figure of 50 times surprised me, and I asked Intel’s James Reinders for a comment. He was quick to respond, noting that:

50X is ridiculous if it encourages you to believe that there is an alternative which is 50X better.  The argument he makes, for a power-efficient approach for parallel processing, is worth about 2X (give or take a little). The best example of this, it turns out, is the Intel MIC [Many Integrated Core] architecture.

Reinders went on to say:

Knights Corner is superior to any GPGPU type solution for two reasons: (1) we don’t have the extra power-sucking silicon wasted on graphics functionality when all we want to do is compute in a power efficient manner, and (2) we can dedicate our design to being highly programmable because we aren’t a GPU (we’re an x86 core – a Pentium-like core for “in order” power efficiency). These two turn out to be substantial advantages that the Intel MIC architecture has over GPGPU solutions that will allow it to have the power efficiency we all want for highly parallel workloads, but able to run an enormous volume of code that will never run on GPGPUs (and every algorithm that can run on GPGPUs will certainly be able to run on a MIC co-processor).

So Intel is evangelising its MIC vs GPCPU solutions such as NVIDIA’s Tesla line. Yesterday NVIDIA’s Steve Scott spoke up to put the other case. If Intel’s point is that a Tesla is really a GPU pressed into service for general computing, then Scott’s first point is that the cores in MIC are really CPUs, albeit of an older, simpler design:

They don’t really have the equivalent of a throughput-optimized GPU core, but were able to go back to a 15+ year-old Pentium design to get a simpler processor core, and then marry it with a wide vector unit to get higher flops per watt than can be achieved by Xeon processors.

Scott then takes on Intel’s most compelling claim, compatibility with existing x86 code. It does not matter much, says Scott, since you will have to change your code anyway:

The reality is that there is no such thing as a “magic” compiler that will automatically parallelize your code. No future processor or system (from Intel, NVIDIA, or anyone else) is going to relieve today’s programmers from the hard work of preparing their applications for the future.

What is the real story here? It would, of course, be most interesting to compare the performance of MIC vs Tesla, or against the next generation of NVIDIA GPGPUs based on Kepler; and may the fastest and most power-efficient win. That will have to wait though; in the meantime we can see that Intel is not enjoying seeing the world’s supercomputers install NVIDIA GPGPUs – the Oak Ridge National Laboratory Jaguar/Titan (the most powerful supercomputer in the USA) being a high profile example:

In addition, 960 of Jaguar’s 18,688 compute nodes now contain an NVIDIA graphical processing unit (GPU). The GPUs were added to the system in anticipation of a much larger GPU installation later in the year.

Equally, NVIDIA may be rattled by the prospect of Intel offering strong competition for Tesla. It has not had a lot of competition in this space.

There is an ARM factor here too. When I spoke to Scott in Beijing, he hinted that NVIDIA would one day produce GPGPUs with ARM chips embedded for CPU duties, perhaps sharing the same memory.