Gradient-based grand canonical optimization enabled by graph neural networks with fractional atomic existence