GPUs do not put their RAM in the same package as the processor itself, and it does not sacrifice a significant amount of performance.
The M-series processors' primary benefit by a huge margin is its architecture that allows a higher memory bandwidth than say SODIMMs and that benefit is independent of the choice to put the RAM in the package.