Tuesday, April 29, 2008

How GPUs are better than CPUs

Intel has a great CPU core right now, AMD does not, and in combination with Intel having higher-performance silicon, Intel is currently beating AMD handily. Meanwhile, Intel and AMD are both integrating graphics into the CPU and NVidia probably feels sidelined. So NVidia says that the CPU is dead. I agree, a little.

Many things people want to do these days are memory bandwidth limited. Editing/recoding video, or even tweaking still pictures and playing games are all memory bandwidth limited. GPUs have far better memory bandwidth than CPUs, because they are sold differently.

The extra bandwidth comes from three advantages that GPUs enjoy:

  • GPU and memory come together on one board (faster, more pins)
  • point-to-point memory interface (faster)
  • cheap GPU silicon real estate means more pins
  • occasional bit errors in GPU memory are considered acceptable
  • GPUs typically have less memory than CPUs

When people buy CPUs, they buy the memory seperately from the CPU. There are 2 chip carriers, one socket, a PC board, and one DIMM connector between the two. In comparison, when people buy GPUs, they buy the memory and the GPU chip together. There are 2 chip carriers and a PC board between the two.

CPU memory interfaces are expected to be expandible. Expandibility has dropped somewhat, so that currently you get two slots, one of which starts out populated and the other of which is sometimes populated and sometimes not. The consequence is that the CPU to DRAM connection has multiple drops on each pin.

GPUs always have one DRAM pin to each GPU pin. If they use more DRAM chips, those chips have more narrow interfaces. Because they are guaranteed point-to-point interfaces, the interfaces can run at higher speed, generally about twice the rate of CPU interfaces.

CPU silicon is optimized for single-thread performance -- both Intel and AMD have very high performance silicon. As a result, the silicon costs more per unit area than the commodity silicon the GPUs are built with. The "programs" that run on GPUs are much more amenable to parallelization, which is why GPUs can be competitive with lower-performance silicon.

It turns out that I/O pins require drivers and ESD protection structures that have not scaled down with logic transistors over time. As a result, pins on CPUs cost more than pins on GPUs, and so GPUs have more pins. That means they can talk to more DRAM pins and get more bandwidth.

All of the above advantages would apply to a CPU if you sold it the same way a GPU is sold. The final two advantages that GPUs enjoy would not apply, but are easy to work around.

The first is the acceptability of bit errors. GPUs do not have ECC. It would be easy to make a CPU/GPU that had a big wide interface with ECC.

The second is the memory size. GPUs typically connect to 8 or 16 DRAM chips with 32b interfaces each. It would be straightforward to connect with 64 DRAM chips with 8b interfaces each. If fanout to the control pins of the DRAMs becomes a problem, off-chip dedicated drivers would be cheap to implement.

So, I think integrated CPU/GPU combinations will be interesting for the market, but I think they will be more interesting once they are sold the way GPUs are sold today. Essentially, you will buy a motherboard from Iwill with an AMD CPU/GPU and 2 to 8 GB of memory, and the memory and processor will not be upgradable.

For servers, I think AMD is going in the right direction: very low power (very cheap) mux chips which connect perhaps 4 or even 8 DRAM pins to each GPU/CPU pin. This solution can maintain point-to-point electrical connections to DIMM-mounted DRAMs, and get connectivity to 512 DRAM chips for 64 GB per GPU/CPU chip.

Sunday, April 20, 2008

Fountain Prototype


Martha and I are building a pool in the back yard. In that pool will be hot tub, and pouring into that hot tub will be a fountain. I want lots of water flow, and curves, especially since the overall pool will be rectangular (due to the automatic cover). To give you an idea, here's the pool:


The hot tub is circular, and has a 1 foot thick wall that seperates it from the pool. Out of the center of that wall, water will leap up, arch over, and fall into the tub. This will pour nicely over your shoulders if you are an adult, and it will make a fancy tube to explore if you are a child.

The trouble is that nobody sells a curved fountain like this. No problem, I'll just assemble it from a number of straight sections. Also, I do not want to use high-pressure pool pumps for this thing. Instead, I want to use low-power, low-pressure pond pumps. The manufacturer of the fountain has specs for the amount of water flow you need, but not the pressure. I smell project risk. Time for a prototype. Here's the overall arrangement: two fountain units, 1 foot wide each, one Sequence 4200seq12 pump, and some pipes to move the water.





I've got a flow gauge, two pressure gauges, and a ball valve so I can figure out how many gallons per minute throws the water how far.


I've also got a peanut gallery. They're interested because they're going to get to dance around in the water in a bit.


The fountains throw water about as far as the manufacturer claims. Note that my flow rates are for two 1 foot units.

Flow rateThrowNotes
48 GPM26.0 inches7 inch rise
45 GPM23.5 inches
41 GPM18.7 inches
37 GPM14.7 inches
35 GPM11.5 inches3+ psi pressure drop

I learned a bunch of things from this prototype:
  • The flow through the two units was not identical. One moved about 8% more water than the other, and threw the water a little further.
  • The flow through each units was not uniform. The unit throwing farther was throwing farther on one end.
  • With no fine filtration, and just a skimmer before the pump, the fountain units quickly accumulated debris that interfered with the flow.
  • The water sheet from each unit contracts from surface tension as it gets farther from the fountain. A 14 degree included angle between the two units turned out to roughly match the contraction, but this still left a constant gap from one to the next. I may try to fix that by mitering the two fountains together.
  • Martha and I agreed that 15 or 20 GPM per linear foot is not enough. We really like 25 GPM/foot better.
  • The fountain water entering the water surface was the cause of all the noise. The pump was really quiet, and you could only hear it when you walked right over to it.
  • The pump really doesn't prime itself. I had to stuff a hose up the intake and fill it full of water before the pump would move anything.
  • This pump can just move 48 GPM with this setup (which implies it is seeing about 5 feet of head). With more angles and losses in the system, I am going to need more pressure at that flow.
I also noted that the water sheet was rough. Water entry was noisy. I took a high-speed shot of the water, and sure enough, it's breaking up in flight. Note also how much shorter the rear fountain is than the front.


I noticed that the flow gauge was bouncing around a fair bit, so I presume I'm getting a bunch of turbulence, which probably does not help the fountains at all. These units are the "short lip" version of these fountains, which means they have just 1" of flow straightener before they launch the water. The standard version has a 6 inch lip, which I think might damp the turbulence more and lead to a cleaner sheet of water.

Inside the unit there are apparently 3 supports of some sort. These have visible wakes, but I wasn't able to see that the wakes caused more breaking up when they hit the edges.


So, my plan is not yet validated.
  • I need bigger pumps. 3 of the 5100SEQ22 will produce 200 gpm total at 10' head. That should give me enough extra force to push through the extra twists and turns.
  • Each fountain unit is going to need it's own throttle. The best way to implement this is probably a bank of eight $20 ball valves, and a seperate run to each fountain unit.
  • As long as I'm doing a seperate run to each fountain unit, I might arrange for the final connection to be long and straight to reduce turbulence. There will be a lot of turbulence in the fountain unit itself, so maybe this is hopeless.
  • I should order a fountain unit with a 6" lip, and see if I like that flow better.

Tuesday, April 08, 2008

Conservation versus outsourcing

Read "The Wonderful Curse of Natural Gas Price Volatility". It's short, just 12 pages long.

Check out the graph at the top of page 9: "U.S. Industrial Gas Demand Destruction". That's a 22% drop in industrial natural gas utilization between 1997 and 2006. That's not efficiency, that's offshoring! What's going on here?

  • Natural gas is a feedstock for the fertilizer, chemical, and plastics industries, and a fuel for the electric generation industry.
  • Electric power generators are less sensitive to the price of their fuel than fertilizer, ethanol, and plastics, since the latter three can all be shipped to us oversea, and electricity cannot.
  • The electric generation industry is sensitive to the capital necessary to build capacity, because the rent on the capital to build their plants has to be priced into the electricity sold, and different plants do compete to produce and sell electricity. Thus, more capital-intensive plants are more likely to have lower return on investment if electricity prices dip.
  • Gas turbine power plants have exceptionally low capital costs, making them very desirable to the power producers, and gas prices were low during the 1980s and 90s.
  • So, electric generators built 200 gigawatts of gas turbine powerplants during the 1990s and early 00s, so that gas turbine plants now constitude 41% of our nameplate capacity (EIA figures). These gas turbine plants are now running at a capacity factor of 21%, and produce 20% of our domestic power (once again, EIA).
  • Figure 7 of page 8 of the Ventyx report shows that between 1997 and 2006, gas consumption by the power generators rose from 11 to 17 billion cubic feet a day. That's all those gas turbines coming on line.
  • It turns out there is a limited supply of domestic natural gas. Demand rose, supply stayed constant, and thus prices rose.
  • Over the same time, industrial consumption dropped from 23 to 18 billion cubic feet a day. That's domestic fertilizer, chemical, and plastics production being moved overseas in response to higher feedstock costs.
  • U.S. consumption of fertilizer, chemicals, and plastics has not dropped, and conversion from the feedstock to the final product increases value, so offshoring has driven the jobs overseas and also increased our trade deficit by much more than the cost of the natural gas consumed by the electric generation industry.
What we have here is another example of a strong negative correlation between the performance of the U.S. power generation industry and the U.S. economy as a whole. This is a tragedy, partially responsible for our $708 billion dollar/year trade deficit. That's an unpaid $2360 bill, per man, woman, and child, per year, for everyone in the United States.

This post and the last one may lead some of you to think I'm all for a command economy. No. I'm pretty sure that if we nationalized the electric power generation industry, we'd end up running it less efficiently, which would also lead to higher domestic power costs. I do think we need to bring the measure of performance of the electric power generation industry into better alignment with the domestic economy.

The domestic economy does well with cheap energy. In this context, gas turbines are a disaster, since they redirect a feedstock away from high-value-added uses (plastics) into low-value-added uses (electric generation). We have readily available substitutes for electric generation (coal and nuclear), but not natural gas. In some sense, all a gas turbine does is convert one kind of energy into another without increasing the domestic supply.

I don't know how to make domestic power producers profit more when the US economy has cheaper energy. The benefit of marginally cheaper power is probably nonlinear, and possibly unmeasureable in any way that would allow accountants to calculate a credit to power producers. I do not want to see more coal powerplants, because of the currently externalized cost of CO2 production, even though they are a cheap source of power. Perhaps the simplest way forward is what we have now: tax credits or subsidies for the obvious answers, like wind and nuclear, and just feel our way through, year by year, guessing which subsidies will distort the electricity market to best serve the interests of our citizens.

I'm sorry to keep harping on this energy and trade stuff, but to be honest, I'm scared. I don't understand how to predict what this trade deficit will do, nor do I understand how big is too big, but $700 billion feels too big. Our trade deficit, national budget deficit, credit crisis, housing market meltdown, and war in Iraq give me the feeling that this nation has derailed and is about to make a very expensive and possibly bloody mess.

The last time we got into a World War, we had just splurged on national infrastructure. Think about this: 90% of the Allied aluminum flying over Germany was made with power from the Grand Coulee Dam, built from 1933 to 1942, i.e. just in time. I'm not saying I expect another World War, but I am saying that when times get tough it's good to have serious infrastructure in your back pocket.

Wednesday, March 26, 2008

Let's drive electricity prices into the ground

Read this report. It's basically a big apology for why electricity prices have been going up.

On page 31, it shows the EIA estimate that a 10% increase in the price of electricity in 2006 would cause a 4% (175 billion kWh/year) drop in electricity demand in 2014, down from 4.2 trillion kWh/year. This is basic supply and demand, with the EIA doing the error-prone work of predicting the demand curve in the future. The first thing I'll note here is that a 10% price increase, coupled to a 4% sales drop, leaves a 6% revenue increase (at least $12 billion/year) coupled with decreased costs for the folks selling electricity. It's an inelastic demand curve. So, if the folks making electricity can do anything to reduce the overall supply, it's well worth their effort.

When the price of electricity goes up, some of that reduction in demand is accomplished by economic activity (buying a more efficient air conditioner), and some is accomplished by reducing economic activity (shutting down the night shift of a marginal plant). Overall, how much of each? My guess is that the reduction in economic activity is the main reducer of demand. Let's suppose I'm right, and that a 4% drop in electric demand is accompanied by a 1% drop in GDP. That's a $130 billion dollar drop.

You can see that price fixing among electricity producers would be seriously damaging to me and you. It is in the national interest that electricity prices not rise 10%. Note that this is true regardless of whether the utilities make or lose money, because as a nation we are making or losing quite a bit more money than the utilities are.

So let's consider a different investor, the U.S. government. Suppose that the electric demand curve slope is locally smooth. A 10% decrease in the cost of electricity, then, sould lead to a 4% increase in sales, and a corresponding 1% increase in GDP. This is what Rod Adams is talking about when he calls electricity an economic lubricant.

How much is that 1% increase worth to the federal government? They tax the GDP at about 18.4%, so it's worth around $24 billion per year. To review:

  • A 10% decrease in the cost of electricity, from $0.07/kWh to $0.063/kWh, would lead, 10 years later, to
  • ...a 4% (175 billion kWh) increase in electricity sales, for a net revenue loss to the industry of
  • ...$12 billion/year. The federal government, however, would be raking in an extra
  • ...$24 billion/year, and the rest of us would be enjoying an additional
  • ...$130 billion/year in GDP.
Sounds good. Let's mandate a drop in prices! Who says we can't have a centrally controlled command economy?

Well, it's not that simple. First, we need to know much investment is required to drive electric prices down 10%. Presuming that the government has to somehow compensate utilities for taking a $12B/year hit for the team, that leaves $12B/year to pay for the capital required. The federal government currently borrows money for 30 years at 4.5% (they are a better credit risk than you), so the capital required for this investment had better be significantly less than $266B.

The Palo Verde nuclear power plant supplies power for $0.027/kWh, including operations (fuel), maintenance, and interest and depreciation costs. In 2002, the marginal cost (not including capital) was 42% less than that for coal in the area, and since then the difference has increased as coal costs have risen. This is the best lever we can use to drive down electricity prices.

To drive down wholesale prices by 10%, we'd need to bring the cost of production down approximately 10%. Using the Palo Verde area numbers from this report, and assuming we keep the same coal and hydro production (as they are both low cost), but reduce gas and increase nuclear, we'd need 49 gigawatts of new nuclear production nationwide. That's not going to happen by 2014, but we would probably see some fraction of the benefit for some fraction of the cost. Just incidentally, 49 gigawatts of new nuclear production scaled up from Palo Verde's employment base is 89,000 extra jobs here in the U.S., paying an average of 13% more than the average American salary.

Palo Verde cost $5.9 billion, was finished in 1988, and has a peak capacity of 3.72 GW and sustains a capacity factor in excess of 90%. We would need 13 more Palo Verdes to produce enough electricity to make that 10% cost reduction happen, at a cost of $77 billion. The generating utilities are not going to take this on, given that the "benefit" is a $12 billion/year loss to them. But for the U.S. government, looking at $24 billion/year in increased tax revenue, the cost of the plants is easily worth it. What remains is determining a way to have the government provide the capital and offset the revenue losses associated with a huge expansion of the nuclear reactor fleet, without getting ourselves further into the management disaster of a command economy.

I'll note that we're going into a recession, and interest rates are falling. This is a good (cheap) time for the government to borrow a bunch of money to invest in long term economic infrastructure. The reactor buildout I'm proposing would cost about the same as the $300/person economic stimulus package our leaders just conjured up. To my mind, the difference is very much teaching a man to fish versus giving him fish.

Tuesday, March 11, 2008

Clinton's choice

I'm watching replays of the CNN Obama/Clinton debate. This is painful.

The argument that Clinton needs, and is failing to make, is that there is a difference between how Senators and Presidents collect the information they need to make their decisions. The Congress does not have an NSA. The President does. Clinton made her decision, one she regrets, on the basis of information provided by George Bush's team. Had she been in President Bush's position, things would be entirely different because she would have had a completely different set of options, including better discovery of what the facts actually were.

She's not making that argument. I'm not sure why, and it suggests to me that she still doesn't think about how to be a President. She's thinking about how to argue about stuff, not how to find the right answer.

There is another angle that Clinton is missing. To win, the Democratic presidential candidate will have to appeal to some Republicans. What is going to go over better? "I was right, you shouldn't have gone to war, now I'm going to fix your mistake and pin the cost on you?" or "We got into this tragedy together, and I will help get us out of it together?" Obama's Iraq message is actually more divisive.

Finally, for what it's worth, the idea of scheduling a withdrawal scares me a lot. I think our withdrawal from Mogadishu contributed directly to the planning of 9/11. I worry about what we're going to be dealing with in 10 years, and where we're going to be dealing with it.

Monday, February 11, 2008

Dessert Recommendation

On Sunday night my wife and three kids had the "Lemon Meringue Ice Cream Pie" at the Half Moon Bay Inn. It was one of the best desserts I have ever had. For dinner I had the cheeseburger, also one of the best burgers I've ever had.

I'd like to put in a Google Maps link, but Maps doesn't have it! Half Moon Bay Inn is at 401 Main Street, Half Moon Bay, CA 650-560-9758.

Subsidizing wheat in Afghanistan

Afghanistan grows most of the world's opium. Opium is technically an illegal crop there, and it is one of the few crops that makes enough money to support a farmer in Afghanistan. If you grow opium, the central government is officially supposed to stop you, and the local official will probably look the other way if you pay him off. It may seem cheaper and easier for the folks growing opium in the Taliban-controlled areas, since the Taliban actively helps farmers sell their crop, in exchange for some of the profit. I'm sure many farmers prefer the Taliban for purely economic reasons.

If wheat sold for more money, perhaps 3 times the world price (which is around $350-$400/metric ton), some folks think the value of the wheat crop would be large enough to encourage many farmers to switch to wheat production. Wheat is legal to grow, so their is no disadvantage for a wheat farmer to having a functional Afghani government. Foreign aid organizations could run grain mills which bought wheat at $1100/ton and sold the flour for $350/ton. Bread prices would presumably stay low as flour flooded the market, and Afghanistan would presumably become an exporter of flour.

Folks in Pakistan and Iran would be encouraged to sell grain to Afghanistan for milling. I'm not entirely sure this is an entirely bad thing. Presumably economic conditions do not vary dramatically as you cross the border, so that areas outside Afghanistan are probably also growing opium. And, as long as we stop bulk cargo deliveries of grain to Afghanistan, one would think it would be expensive to move large quantities of grain by, say, mule across the border. There is some subsidy at which it is not worth moving grain by mule. Hopefully it's cheaper for small Afghani farmers to get their product to the mills than it is for Pakistani importers.

So, how much would this cost? Afghanistan produced 4.4 million metric tons of wheat in 2007/2008, so someone would have to cough up $3.3 billion/year to carry this subsidy. That's real money, and apparently we'd have to keep it up for a decade or so. If there are not large agribusinesses in Afghanistan now, there will be within a year or two. These businesses will get efficient at growing grain in Afghanistan, and start to produce the majority of the grain there. The subsidy on grain will decrease over time, large efficient businesses will capture nearly all of it (as they capture farm subsidies in the U.S.), and the marginal farmers will move back to poppies. I don't have a great deal of hope for this effort.

By the way: anyone have a clue what this is?

Tuesday, February 05, 2008

Cost of oil, revisited

Last time I looked, oil was priced at $22/barrel and we were importing 9.14 million barrels a day, which made up 20% of our trade deficit of $374 billion. We were actually importing more, but I hadn't counted the refined stuff. So it was actually 12.6 million barrels/day, so $101 billion or 27% of the trade deficit.

Now, as you know, the oil spot price is around $95/barrel, but $72/barrel is closer to the average price, and we are importing 12.2 million barrels a day (crude plus some refined products). The census bureau has nicely summarized the data here, which doesn't quite match the simple math I would do. For Dec 2006-Nov 2007, they see petroleum imports as $283 billion (35%) of a $813 billion deficit.

Grim.

How much does a plug-in hybrid help?

  • Over a 20-year lifetime, the car is driven 250k miles.
  • It gets 75 mpg rather than 25 mpg.
  • It burns 80 barrels of oil rather than 320 (and burns a bunch of domestic coal instead).
  • It saves the importation of $15,500 of crude.
  • It saves the user $23,000 in gas.
  • It costs the user $5800 in electricity. (250k miles) / (3 miles/kw-hr) * (0.07 $/kw-hr)
My guess is that a practical plug-in hybrid chews up more electricity and gasoline than this, but it still seems pretty good. Unfortunately,
  • It's made by Toyota in Japan, and costs $25,000, so the net trade debt increases. At least the money is going to a responsible nation like Japan. I will cede that eventually Toyota will make most of these plug-in hybrids here, and so only the profits will go to Japan.
  • If 10 million cars in the U.S. were plug-in hybrids, it would reduce our oil imports by 282,000 barrels/day, or 2.3%.
That last point is a killer. It is just incredibly hard to replace oil.