Set IntentMassiveInsert via Gremlin

I am trying to insert many vertices and edges. For example, I would like to insert around 800k vertices and then insert 1000 edges. The problem I am having is after the vertices are created, the edge creation is REALLY slow. I am creating 100 edges in bulk and it takes about 4 minutes per 100 edges. I think it is because I need to set IntentMassiveInsert.

Is there a way I can set this remotely, or via Gremlin? I also read that I might need to set -XX:MaxDirectMemorySize=32585m. Setting this alone did not seem to solve the problem.