747-8 pitching up and down / Not following VNAV or autopilot commands

During climb the aircraft doesn’t climb smoothly and doesn’t hold its speed. It pitches sharply down and up to maintain speed and altitude. Resulting in heavy oscillation. Does not follow any inputs into the MCP.

It does not always happen, but most of the times when I used this aircraft.