ISLAMABAD, Pakistan (AP) _ Thousands of elite Soviet commandos and paratroopers are leading an attack on anti-Marxist guerrillas in Afghanistan's Kunar Valley, as a military buildup continues for a major border offensive, Western sources said Tuesday.

The diplomatic sources, speaking on condition they not be identified further, said Soviet columns are advancing up the Kunar Valley to the besieged town of Barikot on the Pakistani border.

The columns are spearheaded by 4,000 paratroopers and helicopter-borne commandos who have knocked aside the lightly armed guerrillas, the sources said.

Guerrillas and other sources have put the Soviet troop strength at 10,000, and the diplomatic sources said their figures were based on early reports from the second half of May.

A large Soviet force is also being built up in nearby Paktia province on the border further to the south. Waves of Soviet transport planes and helicopters have been flying reinforcements and supplies to bases at Kabul and Jalalabad or moving them closer toward the border, the sources said.

Guerrilla commanders and Western intelligence sources have said the Soviet drive appears to be the first stage in a major offensive to cut off guerrilla supply lines.

Afghan Islamic guerrillas are locked in a bitter war with the country's communist government and an estimated 115,000 Soviet troops supporting the Kabul regime. The Soviet Unions sent troops across the Afghan border in 1979, presided over the overthrow of one Marxist leader and his replacement by another.

The Afghan guerrillas operate from bases in Pakistan, bringing fighters and supplies through border provinces such as Kunar and Paktia.

An Afghan source, who asked not be identified, said Tuesday that there were reports from Kunar that Soviet paratroopers operating ahead of their main force had seized the village of Narey, about five miles from Barikot. The main Soviet force was about 10 miles further back, he said.

Guerrilla commanders based in the Pakistani border city of Peshawar have admitted most of their units have been withdrawn from the Kunar Valley as the Soviets advanced.

The Afghan Mujahedeen, the main guerrilla alliance, said Tuesday that its fighters shot down a Soviet helicopter last Friday near Barikot and a jet fighter-bomber near Sonack, further down the valley. Diplomatic sources said guerrillas apparently shot down Soviet aircraft by firing down on them from mountain tops as they fly up narrow valleys.

The Soviet crews of both aircraft were killed, the guerrillas said.

Soviet forces have also begun major raids around Kabul, the sources said. Waves of helicopter gunships carrying bombs have been seen lifting off from Kabul air base to attack nearby targets, the sources said.

In one attack May 31, several dozen helicopter gunships and large troop- carrying MiG helicopters raided the Paghman area to the west, and heavy fighting was reported, the sources said.

Fighting has been reported to the south in Kandahar province where guerrilla forces have been active in recent weeks. The diplomatic sources said Soviet forces staged raids on several villages to the west of Kandahar City around May 21 and 22, apparently retaliating for an attack on a Soviet tank and the killing of its crew, the sources said. Several civilians were killed.

Meanwhile, an Afghan court on Tuesday sentenced three men to death after finding them guilty of carrying out guerrilla sabotage missions, the official Afghan government radio said in a broadcast monitored in Islamabad.

The three confessed to setting fire to schools and mosques and bombing a Kabul complex where many top officials live, killing several people, the radio said.

The radio charged the men had been trained in Pakistan with American assistance to attack targets in Afghanistan.