Watching ROTF again Optimus said the last fragment of the Allspark was taken. Way before that scene the Allspark mutants and BB destroyed the Witwicky's house. You see BB didn't see the sliver as he was sent to the garage. He probably thought those were Decepticons. It was probably not until later Optimus put two and two together that there was another fragment. As the Decepticons were chasing Sam.