Elon Musk and Jack Ma debated at a conference in Shanghai

Jack Ma believes artificial intelligence poses no threat to humanity, but Elon Musk called that "famous last words" as the billionaire tech tycoons faced off Thursday in an occasionally animated debate on futurism in Shanghai.

The Chinese co-founder of Alibaba and the maverick industrialist behind Tesla and SpaceX frequently pulled pained expressions and raised eyebrows as they kicked off an AI conference with a dialogue that challenged attendees to keep up, veering from technology to Mars, death, and jobs.

However, the hot topic in the hour-long talk was AI, which has provoked increasing concern among scientists such as late British cosmologist Stephen Hawking who warned that it will eventually turn on and "annihilate" humanity.

"Computers may be clever, but human beings are much smarter," Ma said. "We invented the computer -- I've never seen a computer invent a human being."

While insisting that he is "not a tech guy," the e-commerce mogul added: "I think AI can help us understand humans better. I don't think it's a threat."

Musk countered: "I don't know man, that's like, famous last words."

He said the "rate of advancement of computers in general is insane", sketching out a vision in which super-fast, artificially intelligent devices eventually tire of dealing with dumb, slow humans.

"The computer will just get impatient if nothing else. It will be like talking to a tree," Musk said.

Mankind's hope lies in "going along for the ride" by harnessing some of that computing power, Musk said, as he offered an unabashed plug for his Neuralink Corporation.

Neuralink aims to develop implantable brain-machine interface devices, which conjures images of "The Matrix", whose characters download software to their brains that instantly turns them into martial arts masters.

"Right now we are already a cyborg because we are so well-integrated with our phones and our computers," said Musk, 48.

"The phone is like an extension of yourself. If you forget your phone, its like a missing limb."

But humanity will also have more leisure time in the future as AI takes on much of the burden of transporting, feeding, and thinking for earthlings, said Ma.

"People could work as little as three days a week, four hours a day with the help of technology advances," he said.

Ma, 54, who steps down next month as head of Alibaba Group, questioned Musk's push to develop spacecraft that could help us colonise Mars.

"We need a hero like you, but we need more heroes like us improving things on earth," Ma said.

Musk countered that we must master interplanetary travel in case earth becomes uninhabitable.

Scientists like Hawking have said the same, citing the risk of nuclear war, a devastating virus, global warming or asteroid collision.

But not to worry: both agreed that human mortality is a good thing as each generation brings new ideas to the global challenges we face.

"It's great to die," Ma said, with Musk adding: "That's probably true."