MANILA, Philippines (AP) _ President Ferdinand E. Marcos granted amnesty today to 30 people the government said were Communist and Moslem separatist rebels who had surrendered.

In ceremonies at the presidential palace, Marcos welcomed 12 members of the Communist New People's Army and 18 commanders of the Moro National Liberation Front, a group that has been fighting for Moslem self-rule on southern Mindanao Island for more than a decade.

Marcos also named Alawi Mohamad Abas, a former Moslem rebel leader, as presidential adviser on Moslem affairs. A palace news release said Abas was one of the front's founders in 1969 and among its first officers to train abroad.

Marcos ordered government agencies to provide funds to rehabilitate and train those who surrendered, the palace said.

Elsewhere, the official Philippine News Agency reported today that government troops killed two suspected Communist guerrillas Sunday in Zamboanga del Sur province, 540 miles southeast of Manila.

The agency said guerrillas killed three farmers who were on their way to a cemetery Saturday near the site where the insurgents were slain.