Dogs experiencing a gastrointestinal upset will often eat grass.
They tend to eat it at a frantic pace, and in fairly large amounts.
The bottom line is that frequent gastrointestinal upsets as would be indicated by eating grass frequently and vomiting afterward can certainly be a sign that the diet needs correction.