Nvidia briefly surpassed Apple as the world's most valuable company on Friday following a stock market rally powered by the demand for the company's artificial intelligence (AI) chips.