The government reported yesterday that business inventories continued to rise significantly in May, but the increase stemmed mostly from a falloff in auto sales and did not reflect excessive stockbuilding throughout the economy.

Commerce Department figures showed overall inventory levels up $4.67 billion, or 1.2 percent, over the month following a jump of $5.62 billion, or 1.4 percent, in April. Inventories in May stood at $402 billion.

However, the jump was primarily at the retail level, with the bulk of that concentrated in new-car dealerships, whose sales have plummeted recently in the wake of the nationwide gasoline shortage.

The closely-watched ratio of stocks to sales - the primary indicator of possible excess inventory accumulation in the economy - remained essentially unchanged in May with stock equaling 1.4 months' sales.

The figures came as, separately, the Agriculture Department predicted the U.S. would harvest a bumper winter wheat crop this year, but said the corn yield probably will be down from 1978 levels.

The department estimated the winter wheat crop output will total 1.56 billion bushels, up 25 percent from last year's 1.25 billion-busehl level. The corn crop was pegged at 6.66 billion bushel down 6 percent from 1978's record 7.08 billion.

At the same time, the agency said the Soviet Union probably will need significantly more grain than officials here thought previously as a result of poor harvests in that country.

The department earlier had estimated the Soviet crop would yield between 170 million and 210 million metric tons of grain. Yesterday, however, it reduced this range to 165 million to 195 million metric tons.

The increased purchases from the Soviet Union are considered likely to exert some upward pressure on grain prices here, but officials said it is unlikely the rise will be sufficient to hurt American consumers.

Meanwhile, the F. W. Dodge Division of Mcgraw-Hill Corp. estimated that the pace of contracts for new construction will slow by about 5 percent this year, but their dollar value still will exceed 1978 because of inflation.

Among the sharpest declines Dodge predicted for 1979 is a 12 percent drop in the number of contracts for residential construction. The amount of space in commercial buildings is expected to rise a modest 3 percent, Dodge said.

The figures on inventories showed stocks held by manufacturers rose 1.1 percent in May to $211.26 billion after rising 1.7 percent in April. Retail inventories grew 1.7 percent after rising 1.1 percent in April.

Inventories of wholesalers rose 0.7 percent in May following a 1.1 percent rise in April. Sales rose 3.1 percent in May after plunging 3.2 percent in April. However, sales levels still were below those posted in March.