Yes, it totally counts and is indeed being vertically stacked on Ryzen products today. Cache takes up a huge portion of total die area and doesn’t hurt temperatures too much.
For now, AMD is using the technique to add more cache to their CPUs rather than moving all of it to another layer.