The tech sector helped US stocks cruise to all-time highs last week, as the artificial intelligence boom broadened.